ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Date and time functions
  • Calculation mode
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
RealToDateTime (Function)
In french: RéelVersDateHeure
Converts an 8-byte real to a date and time. This real corresponds to:
  • the number of elapsed days since January 1, 1900 (compatible with Excel, starts with 1)
  • the number of elapsed days since January 1, 1904 (compatible with Excel by checking the option "Use 1904 date system", starts with 0).
Note: The "Use calendar since 1904" option can be configured in MS Excel's advanced options. In Open Office, this option is available in the options of Open Office Calc ("Calculate" section, "Date" option).
Example
// Affiche "19000103060000000"
Info(RealToDateTime(3.25))
Syntax
<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 YYYYMMDDHHmmSSCCC format (YYYY corresponds to the year, MM to the month, DD to the day, HH to hours, mm to minutes, SS to seconds and CCC to milliseconds).
  • an empty string ("") if an error occurs.
<Value>: Real
Value to convert.
<From 1904>: Optional boolean
Calculation mode:
  • True if the date is calculated from 1904.
  • False (default value) if the date is calculated from 1900.
Remarks

Calculation mode

The integer part of the real gives the serial number that corresponds to the date in the result:
  • the count starts with 1 for 01/01/1900
  • the count starts with 0 for 01/01/1904 if <From 1904> is set to True.
The decimal part gives the fraction of a day corresponding to the time in the result (e.g. 0.25 corresponds to "060000000").
Caution: Any type conversion may result in a loss of precision.
Component: wd300std.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help