Cicode Programming Reference > Cicode Function Categories > String Functions Introduction > StrToDate

StrToDate

Converts a "date" string into a time/date variable. This variable is the same as returned from the TimeCurrent() function. To set the order of the day, month, and year, and the delimiter, use the Windows Control panel.

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

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

Syntax

StrToDate(String)

String:

The source string.

Return Value

A time/date variable, or 274 if the time/date is out of range.

Related Functions

StrToPeriod, StrToTime

Example

! Australian format (dd/mm/yy) is set in the Windows Control panel.
DateVariable=DateAdd(StrToDate("3/11/95"),86400);
NewDate= TimeToStr(DateVariable, 2);
! Adds 24 hours to 3/11/95 and sets NewDate to "4/11/95".

See Also

String Functions