Skip to main content
Skip table of contents

f$Date (f$Datum)


f$Date (f$Datum)

Get the current date or time

Syntax:

Date = f$Date( DateFormat, Language ) or
Date = f$Date( DateFormat ) or
Date = f$Date()

 

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):
Language "D": Mon, Die, Mit, Don, Fre, Sam, Son
Language "GB": Mon, Tue, Wed, Thu, Fri, Sat, Sun

dddd

day of the week (unabbreviated)
Language"D": Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag, Sonntag
Language "GB": Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

M

month (1..12)

MM

month, two digits (01..12)

MMM

abbreviated month name:
Language"D": Jan, Feb, Mär, Apr, Mai, Jun, Jul, Aug, Sep, Okt, Nov, Dez
Language "GB": Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

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 = ’08.05.97’

Date = f$Date( ’dddd, MMMM d yyyy’ )
→ Date = ’Thursday, May 8 1997’

Date = f$Date( ’t. MMMM jjjj’, ’D’ )
→ Date = ’8. Mai 1997’


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.