asDate

asDate(): Date;

The asDate method of the StringUtf8 primitive type returns a date based on the contents of the receiving string.

If the receiving string does not contain a valid date, "invalid" is returned.

The data value must represent one of the following date formats.

Any non-alphanumeric character can be used as a delimiter.

JADE converts a two-digit year as follows.

Always use four-digit years in your applications.

The following example shows the use of the asDate method.

vars
    dateValue : Date;
begin
    dateValue := @"15 May 2010".asDate;   // 15 May 2010
    dateValue := @"15-May-2010".asDate;   // 15 May 2010
    dateValue := @"15/5/2010".asDate;     // 15 May 2010
    dateValue := @"May 15, 2010".asDate;  // 15 May 2010
    dateValue := @"2010:5:15".asDate;     // 15 May 2010
    dateValue := @"29/2/2011".asDate;     // "*invalid*"
end;