Cicode Programming Reference > Cicode Function Categories > Time and Date Functions Introduction > Date

Date

Gets the current date in string format.

Note: Time/Date functions can only be used with dates between 1980 and 2035. You should check that the date you are using is valid with Cicode similar to the following:

IF StrToDate(Arg1)>0 THEN
...
ELSE
... END

Syntax

Date( [Format] )

Format:

The format required:

2 - Short date format, dd/mm/yy

3 - Long date format, day month year

9 - Extended date format, dd/mm/yyyy

If omitted, the default Format is 2. These formats follow the Regional Settings found in the Windows Control Panel.

Return Value

The current date (in string format).

Related Functions

Time, TimeToStr, TimeCurrent

Example

/* If the current system date is 3rd November 1991 and the Windows
date format is dd/mm/yy; */
str = Date();
! Sets str to "3/11/91".
str = Date(2);
! Sets str to "3/11/91".
str = Date(3);
! Sets str to "3rd November 1991".

See Also

Time/Date Functions