asDate

asDate(): Date;

The asDate method of the String 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.

You should always use four-digit years in your applications.

When enhanced locale support is not enabled(that is, the EnhancedLocaleSupport parameter in the [JadeEnvironment] section of the JADE initialization file is set to false), if the current year is:

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;