Converts an 8-byte real into a date and time. This real corresponds to:
- the day number from January 1st 1900 (compatible with Excel, starts from 1)
- the day number from January 1st 1904 (compatible with Excel with the option "Use the calendar from 1904", starts from 0).
Note: The option "Use the calendar from 1904" can be configured in the advanced options of MS Excel. In Open Office, this option is available in the options of Open Office Calc ("Calculate" item).
// Displays "19000103060000000"
<Result> = RealToDateTime(<Value> [, <From 1904>])
<Result>: DateTime variable or character string
Value of the date and time. Can correspond to:
- a DateTime variable.
- a character string in YYYYMMDDHHMMSSLLL format (YYYY corresponds to the year, MM to the month, DD to the day, HH to the hour, MM to the minutes, SS to the seconds and LLL to the milliseconds).
- an empty string ("") if an error occurred.
Value to convert.
<From 1904>: Optional boolean
- True if the date is calculated from 1904.
- False (default value) if the date is calculated from 1900.
The integer part of the real gives the day number of the date part of the result:
- the numbering starts from 1 for 01/01/1900
- the numbering starts from 0 for 01/01/1904 if <From 1904> is set to True.
The decimal part gives the day fraction of the time part of the result (for example, 0.25 gives a time part "060000000").
Business / GUI classification : Neutral code