5.5.1.2.3 Let-coercion to and from Date
A Date value can be converted to or from a standard Double representation of a date/time, defined as the fractional number of days after 12/30/1899 00:00:00. As Date values representing times with no date are represented as times within the date 12/30/1899, their standard Double representation becomes a Double value greater than or equal to 0 and less than 1.
The semantics of Date Let-coercion depend on the source’s value type and the destination’s declared type:
Source Value Type |
Destination Declared Type |
Semantics |
---|---|---|
Date |
Date |
The result is a copy of the source date. |
Date |
Any numeric type or Boolean |
The result is the standard Double representation of the source date Let-coerced to the destination type. |
Any numeric type or Boolean |
Date |
The source value is converted to a Double using the Let-coercion rules for Double. This Double representation is then interpreted as a standard Double representation of a date/time and converted to a Date value. If this date value is within the range of valid Date values, the result is the converted date.
Otherwise, runtime error 6 (Overflow) is raised. |