Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Time functions

&pagelevel(3)&pagelevel

For conversion to seconds, the time functions described in this manual by default use 1/1/1970 00:00:00 as the reference date (epoch).

As a result, the time functions ctime, difftime, ftime, gmtime, localtime, mktimeand time supply correct results from 12/13/1901 20:45:52 up to 1/19/2038 03:14:07. Using the link switch TIMESHIFT is not necessary anymore.

This is an incompatible change in respect to the CRTE versions up to V2.9 as well as V10.0A and V11.0A.

If you require the previous behaviour compatible to the specified CRTE versions (reference date 1/1/1950), you have to use the link switch TIME50.

This link switch is necessary if time stamps are to be processed which have been created with 1/1/1950 as the reference date (epoch).

However, the time functions mentioned above don‘t supply correct result anymore for time stamps after 1/19/2038 03:14:07. Especially, a call of the functions time and ftime cause the termination of the program, as the current date is higher than 1/19/2018.

The bind option is contained in the libraries SYSLNK.CRTE.TIME50 and SKULNK.CRTE.TIME50

To use the bind option, enter the following statement when binding:

INCLUDE-MODULE LIB=<library>,ELEMENT=*ALL

Time functions with 64-bit time counter

The ctime64, difftime64, ftime64, gmtime64, localtime64, mktime64 and time64 functions use a 64-bit time counter. In contrast to the corresponding functions with a 32-bit counter (ctime, difftime, ftime, gmtime, localtime, mktime and time) they will therefore supply correct results from 1/1/1900 00:00:0 up to 3/18/4317 02:44:48. In the case of the time functions with a 64-bit time counter, the reference date is always 1/1/1970 00:00:00.