Purpose
Returns a Date value, given an integer. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
NumberToDate( numeric_date )
numeric_date is an integer representing the date in a YYYYMMDD format, where YYYY is the year, MM is the month between 01 (January) and 12 (December), and DD is the day of the month between 01 and 31.
Return Value
Description
The NumberToDate() function returns a Date value represented by an eight-digit integer. For example, the following function call returns a Date value of December 31, 2015:
NumberToDate(20151231)
Example
The following example subtracts one Date value from another Date. The result of the subtraction is the number of days between the two dates. i_elapsed contains the number of days since January 1, 2016.
Dim i_elapsed As Integer
i_elapsed = CurDate() - NumberToDate(20160101)
See Also:
Date and Time Functions, StringToDate() function, Set Format statement, Str$() function, NumberToDateTime() function, NumberToTime() function