1FUNCTION::CTIME(3stap) Time utility functions FUNCTION::CTIME(3stap)
2
3
4
6 function::ctime - Convert seconds since epoch into human readable
7 date/time string
8
10 ctime:string(epochsecs:long)
11
13 epochsecs
14 Number of seconds since epoch (as returned by gettimeofday_s)
15
17 Takes an argument of seconds since the epoch as returned by
18 gettimeofday_s. Returns a string of the form
19
20 “Wed Jun 30 21:49:08 1993”
21
22 The string will always be exactly 24 characters. If the time would be
23 unreasonable far in the past (before what can be represented with a 32
24 bit offset in seconds from the epoch) the returned string will be “a
25 long, long time ago...”. If the time would be unreasonable far in the
26 future the returned string will be “far far in the future...” (both
27 these strings are also 24 characters wide).
28
29 Note that the epoch (zero) corresponds to
30
31 “Thu Jan 1 00:00:00 1970”
32
33 The earliest full date given by ctime, corresponding to epochsecs
34 -2147483648 is “Fri Dec 13 20:45:52 1901”. The latest full date given
35 by ctime, corresponding to epochsecs 2147483647 is “Tue Jan 19 03:14:07
36 2038”.
37
38 The abbreviations for the days of the week are ‘Sun’, ‘Mon’, ‘Tue’,
39 ‘Wed’, ‘Thu’, ‘Fri’, and ‘Sat’. The abbreviations for the months are
40 ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’,
41 ‘Nov’, and ‘Dec’.
42
43 Note that the real C library ctime function puts a newline ('\n')
44 character at the end of the string that this function does not. Also
45 note that since the kernel has no concept of timezones, the returned
46 time is always in GMT.
47
48
49
50SystemTap Tapset Reference August 2011 FUNCTION::CTIME(3stap)