f$Date (f$Datum)
f$Date (f$Datum)
Get the current date or time
Syntax: | Date = f$Date( DateFormat, Language ) or | ||
| Argument | Type | Meaning |
| DateFormat | String | Date format (default: "dd.MM.yy") !optional! (see below) |
| Language | String | Language "D" (German, default) or "GB" !optional! |
Result: | String | Date in chosen format | |
Date format:
The following identifiers are permitted:
d | day of the month (1..31) |
dd | two-digit day of the month (01..31) |
ddd | day of the week (abbreviated): |
dddd | day of the week (unabbreviated) |
M | month (1..12) |
MM | month, two digits (01..12) |
MMM | abbreviated month name: |
MMMM | month name advertised |
yy | year, two digits (00..99) |
yyyy | year, four digits (1997..9999) |
w | running number of the day of the week (1..7), beginning with Monday |
ww | calendar week (1..53) |
h | hour (0..23) |
hh | hour, two digits (00..23) |
m | minute (0..59) |
mm | minute, two digits (00..59) |
s | seconds (0..59) |
ss | seconds, two digits (00..59) |
"..." | Text enclosed in quotation marks is accepted as text constants, i.e. possible identifiers contained within are not searched for. |
All other components of the format entry are constant characters, e.g. "." as date separator.
In order to support the German version, the d and y identifiers can also be replaced by t (Tag) and j (Jahr).
To get the date in the format of the regional settings, read this in the registry:
Date format = f$ReadRegValue( ’HKEY_CURRENT_USER\\Control Panel\\International\\sShortDate’ )
The date format returned can be used directly.
Examples: | Date = f$Date() Date = f$Date( ’dddd, MMMM d yyyy’ ) Date = f$Date( ’t. MMMM jjjj’, ’D’ ) |