NumberToDateTime() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns a DateTime value. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

NumberToDateTime( numeric_datetime ) 

numeric_datetime is an seventeen-digit integer in the form YYYYMMDDHHMMSSFFF. For example, 20140301214237582 represents March 1, 2014 9:42:37.582 PM.

Return Value

DateTime

Example

Copy this example into the MapBasic window for a demonstration of this function.

dim fNum as float
dim Y as datetime
fNum = 20140301214237582
Y = NumbertoDateTime (fNum)
Print FormatDate$(GetDate(Y))
Print FormatTime$(GetDate(Y),"hh:mm:ss.fff tt")

See also:

FormatTime$() function, GetTime() function, NumberToDate() function, NumberToTime() function