function::ctime.3stap

Langue: en

Autres versions - même langue

Version: August 2010 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

function::ctime - Convert seconds since epoch into human readable date/time string.

SYNOPSIS

     ctime:string(epochsecs:long)
 

ARGUMENTS

epochsecs

Number of seconds since epoch (as returned by gettimeofday_s).

GENERAL SYNTAX

ctime:string(epochsecs:long)

DESCRIPTION

Takes an argument of seconds since the epoch as returned by gettimeofday_s. Returns a string of the form

lqWed Jun 30 21:49:08 1993rq

The string will always be exactly 24 characters. If the time would be unreasonable far in the past (before what can be represented with a 32 bit offset in seconds from the epoch) the returned string will be lqa long, long time ago...rq. If the time would be unreasonable far in the future the returned string will be lqfar far in the future...rq (both these strings are also 24 characters wide).

Note that the epoch (zero) corresponds to

lqThu Jan 1 00:00:00 1970rq

The earliest full date given by ctime, corresponding to epochsecs -2147483648 is lqFri Dec 13 20:45:52 1901rq. The latest full date given by ctime, corresponding to epochsecs 2147483647 is lqTue Jan 19 03:14:07 2038rq.

The abbreviations for the days of the week are oqSuncq, oqMoncq, oqTuecq, oqWedcq, oqThucq, oqFricq, and oqSatcq. The abbreviations for the months are oqJancq, oqFebcq, oqMarcq, oqAprcq, oqMaycq, oqJuncq, oqJulcq, oqAugcq, oqSepcq, oqOctcq, oqNovcq, and oqDeccq.

Note that the real C library ctime function puts a newline ('\n') character at the end of the string that this function does not. Also note that since the kernel has no concept of timezones, the returned time is always in GMT.