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