PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

This page concerns the 23 + version of WINDEV, WEBDEV, WINDEV Mobile. Upgrade your version.
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
DateTimeToEpoch (Function)
In French: DateHeureVersEpoch
Converts a local date-time to the Epoch format (number of time units from 01/01/1970 at 00h00 UTC).
Example
// Displays "1501056581" (in France)
Info(DateTimeToEpoch("20170726100941"))
Syntax
<Result> = DateTimeToEpoch(<Data to Convert> [, <Conversion Options>])
<Result>: 8-byte integer
  • Date and time in Epoch format (number of time units since 01/01/1970 at 00h00 UTC).
  • -1 if an error occurred (invalid date and time).
<Data to Convert>: Character string (with quotes)
Local date and time to convert. Can correspond to:
  • a DateTime variable.
  • a character string with one of the following formats:
    • YYYYMMDDHHMMSSLLL
    • YYYYMMDDHHMMSSCC
    • YYYYMMDDHHMMSS
    • YYYYMMDDHHMM
    • YYYYMMDDHH
    • YYYYMMDD
This parameter will be considered as being invalid in the following cases:
  • if the date is invalid or if it is earlier than 01/01/1970. The date validity can be checked by DateValid.
  • if the time is invalid. The time validity can be checked by TimeValid.
Note: You have the ability to use dates beyond year 2038.
<Conversion Options>: Optional Integer constant
Options for converting the date and time to Epoch format:
epochUnixMillisecondThe result will be expressed in milliseconds from 01/01/1970 at 00h00 UTC (time 0 in Unix).
epochUnixSecond
(default value)
The result will be expressed in seconds from 01/01/1970 at 00h00 UTC (time 0 in Unix).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Linux wd230std.so
Minimum required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment