Returns the numeric date value from input date-string according to the
date-format specified. The date returned is the number of seconds elapsed
since midnight, January 1, 1970.
If the date or the date format strings are invalid, an error is returned.
Syntax
@TODATEEX(date_format_string, string)
Parameter | Description |
---|---|
date_format_string | One of the following literal strings (excluding ordered-list numbers and parenthetical examples) indicating a supported date format.
|
string | A date string following the rules of internal-date-format. The following examples correspond to the above listed internal date formats.
|
Notes
- This function is case-sensitive. For example, using apr instead
of Apr returns an error. - Using extra whitespace not included in the internal format
strings returns an error. - Trailing characters after the date format has been satisfied
are ignored. If you erroneously use a date string of 06/20/2006 with
date format mm/dd/yy, the trailing 06 is ignored
and the date is interpreted as June 20, 2020. - Long Format (Weekday, Mon dd, yyyy) is not verified for a
day-of-week match to the given date.For example: For date string Sunday,
March 13, 2007 with date format Long Format, the input date string
is parsed correctly for March 13, 2007, although March 13, 2007
does not fall on Sunday. - This function interprets years in the range 1970 to 2037.
If the function is invoked using a date string outside the year bounds, an
error is returned. - When the yy format is used, this function interprets
years in the range 1970 to 2029.
See Also
- @DATEDIFF
- @DATEPART
- @DATEROLL
- @FORMATDATE
- @TODAY