10 6 27 IsDate

LANSA Technical

10.6.27 IsDate

IsDate will return true if the string can be converted to a valid date in the specified format. IsDate will often be used before AsDate to better handle potential date errors.

Input Parameters

Format - Date format expected in the string variable. Allowable formats are:

CCYY/DD/MM

CCYY/MM/DD

CCYYDDMM

CCYYMM

CCYYMMDD

DD/MM/CCYY

DD/MM/YY

DDMMCCYY

DDMMYY

ISO

MM/DD/CCYY

MM/DD/YY

MMCCYY

MMDDCCYY

MMDDYY

MMYY

SysFmt6

SysFmt8

xYYMMDD

YY/MM/DD

YYMM

YYMMDD

Example

If (#String.IsDate(DDMMYY)

 

#Date := #String.Asdate(ddmmyy)

 

else

 

* Error processing

 

Endif

 

Also see

Date Format

Ý 10.6 Alphanumeric/String Intrinsic Functions