Page 1 of 1

DATE$ formats

Posted: Mon Apr 09, 2018 2:06 pm
by guest
(copied from the old forum)

In LB4 DATE$ provides only three formats for returning the date as a string:

Code: Select all

  print date$("mm/dd/yyyy") ' 01/30/2012
  print date$("mm/dd/yy")   ' 01/30/12
  print date$("yyyy/mm/dd") ' 2012/01/30
LBB is more flexible, it will return the date in any format that can be constructed from the following elements, in any order, separated by '/' or '-':

d     Day of month as digits with no leading zero for single-digit days.
dd    Day of month as digits with leading zero for single-digit days.
ddd   Day of week as a three-letter abbreviation.
dddd  Day of week as its full name.
m     Month as digits with no leading zero for single-digit months.
mm    Month as digits with leading zero for single-digit months.
mmm   Month as a three-letter abbreviation.
mmmm  Month as its full name.
y     Year as last two digits, but with no leading zero for years less than 10.
yy    Year as last two digits, but with leading zero for years less than 10.
yyyy  Year represented by full four digits.

So for example:

Code: Select all

print date$("dddd dd-mmmm-yyyy") ' Sunday 30-January-2012
Richard.