Date$

Purpose:

Converts a date to a string based on the country code, culture identifier, and date format specified in the second (optional) parameter.

 

Composition of the format string: this is a normal string into which placeholders can be embedded.

Place holder

Description

%d

Day (1..31)

%<n>d

Day to <n> digits

%0<n>d

Day to <n> digits, filled on left with '0's

%w

Weekday (1..7)

%<n>w

Weekday to <n> digits

%0<n>w

Weekday to <n> digits, filled on left with '0's

%W

Week of year

%<n>W

Week of year to <n> digits

%0<n>W

Week of year to <n> digits, filled on left with '0's

%m

Month (1..12)

%<n>m

Month to <n> digits

%0<n>m

Month to <n> digits, filled on left with '0's

%y

Year

%<n>y

Year, to <n> digits

%0<n>y

Year, to <n> digits, filled on left with '0's

%q

Quarter

%D

Weekday, written out

%M

Month, written out

"%e", "%<n>e"

Year in the local calendar (Japan: Emperor's year)

"%g", "%<n>g"

Era of the local calendar (Japan: Emperor’s era)

"%g", "%1g"

Single letter, Latin letters

"%gg", "%2g"

Single letter, localized

"%ggg", "%3g"

Long name, localized

"%gggg", "%4g"

Long name, Latin letters

"%x"

Localized date, short form

%H

Hours in 24h-format

%h

Hours in 12h-format

%<n>h

Hours in <n> digits

%i

Minutes

%<n>i

Minutes in <n> digits

%s

Seconds

%<n>s

Seconds in max. 2 digits

%PM

AM or PM

 

Parameter:

Date            Value to be formatted.

String          (optional) Country code (ISO 3166-1 alpha-2, ISO 3166-1 alpha-3, ISO 3166-1 numeric-3), culture identifier, or date format (see the corresponding tab), e.g., 'US', 'USA', '840', 'en-US', or '%D, %d/%M/%y'. Default: System setting

String          (optional) Depending on the second parameter (see Designer Manual), either the country code/culture identifier (see second parameter) or a switch for short/long date format (0: short form, 1: long form). Default: 0

Return value:

String

Example:

Date$(Today(),"%D, %d/%m/%y") Result: Thursday, 8/11/2015

Date$(Today(),"%2WthWeek; %D, %2d/%2m/%4y")     Result: 45th Week, Thursday, 8/11/2015

Date$(Today(),"%D, %3d/%02m/%4y")   Result: Thursday,  8/11/2015

Date$ (Now(),"%02h:%02i:%02s %PM")   Result: 04:03:50 PM