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) an error will occur (which can be
25 avoided with try/catch). If the time would be unreasonable far in the
26 future, an error will also occur.
27
28 Note that the epoch (zero) corresponds to
29
30 “Thu Jan 1 00:00:00 1970”
31
32 The earliest full date given by ctime, corresponding to epochsecs
33 -2147483648 is “Fri Dec 13 20:45:52 1901”. The latest full date given
34 by ctime, corresponding to epochsecs 2147483647 is “Tue Jan 19 03:14:07
35 2038”.
36
37 The abbreviations for the days of the week are ‘Sun’, ‘Mon’, ‘Tue’,
38 ‘Wed’, ‘Thu’, ‘Fri’, and ‘Sat’. The abbreviations for the months are
39 ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Oct’,
40 ‘Nov’, and ‘Dec’.
41
42 Note that the real C library ctime function puts a newline (´\n´)
43 character at the end of the string that this function does not. Also
44 note that since the kernel has no concept of timezones, the returned
45 time is always in GMT.
46
48 tapset::ctime(3stap)
49
50
51
52SystemTap Tapset Reference June 2018 FUNCTION::CTIME(3stap)