asDate
- function
- The asDate() and asTime() functions (often called using the as date and as time operators) convert a value to a known date/time. These are slightly different from the date() and time() functions -- instead of using the standard formats, they will pick up the format to use from the text itself:
put date("mar 16, 1927") -- "03/16/27" (the same as before)
put asDate("mar 16, 1927") -- "Mar 16, 1927" (new behavior)
- Both the date and asDate functions yield a date/time value that is normalized to noon on the given day.
- One common use for the asDate function is to perform comparison of values as dates.
if the date comes after "March 16" as date then …