StrToDateDef

Top  Previous  Next

Prototype

 

floatOutput:= StrToDateDef(strInput,floatDefault)

 

Description

 

It converts in date the string assigned by parameter and return the default value if the conversion fail.

 

Parameters

 

strInput: input string.

 

floatDefault: default value.

 

Returned value

 

floatOutput: output number (date).

 

Notes

 

The output number shows the days that have been spent since 1st January 1900. The conversion format is in according to System setting

 

Example

 

//It asks to insert the data

Date:=ShowInputBox('Data','Write today date in following format dd/mm/yyyy','');

 

//if it is possible convert the date otherwise write system data

FloatData:= StrToDateDef(Date,Now);