DateNum
(Engine-Level Function)
Description: | Returns the number of days since January 1, 1970 for a given date. |
Returns: | Numeric |
Usage: | Script or steady state. |
Function Groups: | Time and Date |
Related to: | Date | Day | Month | Today | Year |
Format: | DateNum(Day, Month, Year[, ValidateInputRanges]) |
Parameters: |
Day |
Required. Any numeric expression giving the day of the month for the date. |
Month |
Required. Any numeric expression giving the month number for the date. January is month 1. |
Year |
Required. Any numeric expression giving the year of the date. The full four-digit date must be used. |
ValidateInputRanges |
Optional Boolean. If set to TRUE, this function will validate the Day and Month parameters to be in their valid range. If both Day and Month are legal values for the given year, DateNum will return days since January 1, 1970, for a given date. Otherwise, this will return Invalid. Defaults to FALSE, meaning that a value will be calculated without verification that the Day and Month parameters are within a valid range. |
Comments: | This function performs the inverse function of the Day, Month, and Year functions. |
Example:
NumDays = DateNum(14, 11, 1986);
NumDays is set to 6161, which is the number of days between 1 January 1970 and 14 November 1986.