Date data type
The date data type is used to represent an instant in time, composing of a date and a time of day.
Value range
The smallest possible value is 00:00:00 (midnight), January 1, 0001.
The largest value is 23:59:59.9999999, December 31, 9999.
All values are Anno Domini (Common Era) in the Gregorian calendar.
Precision
The smallest increment is 100 nanoseconds of elapsed time. A nanosecond is equal to one billionth of a second.
The current date and time
CurrentDate
returns the current local date and time, CurrentDateUtc
returns the current date and time expressed as the Coordinated Universal Time (UTC).
Literals
A date can be expressed as a literal using the #yyyy-MM-dd HH:mm:ss.fffffff#
syntax.
A literal can be just a date, just a time, or both. The seconds and fractions of seconds are optional.
Examples: #2013-05-29#
, #14:23#
, #14:23:15#
, #2013-05-29 14:23:15#
, #2013-05-29 14:23:15.1234567#
The literal can be followed by a method in the same way a variable can. For example: #2013-05-29 14:23:15#.ToText('MMMM')
Methods
Name | Description | Return type |
---|---|---|
Day | Returns the day of the month. | Number |
Encrypt | Encrypts this date. | Text |
Equals | Returns a value indicating whether this date is equal to another specified date. | Boolean |
GreaterThan | Returns a value indicating whether this date is greater than another specified date. | Boolean |
GreaterThanOrEquals | Returns a value indicating whether this date is greater than or equal to another specified date. | Boolean |
Hour | Returns the hour component. | Number |
LessThan | Returns a value indicating whether this date is less than another specified date. | Boolean |
LessThanOrEquals | Returns a value indicating whether this date is less than or equal to another specified date. | Boolean |
Minute | Returns the minute component. | Number |
Month | Returns the month component. | Number |
ToText | Returns the equivalent text representation. | Text |
Year | Returns the year component. | Number |