function::ctime(3stap) — Linux manual page

NAME | SYNOPSIS | ARGUMENTS | DESCRIPTION | SEE ALSO | COLOPHON

FUNCTION::CTIME(3stap)   Time utility functions   FUNCTION::CTIME(3stap)

NAME         top

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

SYNOPSIS         top

       1) ctime:string(epochsecs:long)

       2) ctime:string()

ARGUMENTS         top

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

DESCRIPTION         top

       1) Takes an argument of seconds since the epoch as returned
       bygettimeofday_s. Returns a string of the form

       2) “Wed Jun 30 21:49:08 1993”

       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) an
       error will occur (which can be avoided with try/catch). If the
       time would be unreasonable far in the future, an error will also
       occur.

       Note that the epoch (zero) corresponds to

       “Thu Jan 1 00:00:00 1970”

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

       The abbreviations for the days of the week are ‘Sun’, ‘Mon’,
       ‘Tue’, ‘Wed’, ‘Thu’, ‘Fri’, and ‘Sat’. The abbreviations for the
       months are ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’,
       ‘Aug’, ‘Sep’, ‘Oct’, ‘Nov’, and ‘Dec’.

       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.

SEE ALSO         top

       tapset::ctime(3stap)

COLOPHON         top

       This page is part of the systemtap (a tracing and live-system
       analysis tool) project.  Information about the project can be
       found at ⟨https://sourceware.org/systemtap/⟩.  If you have a bug
       report for this manual page, send it to systemtap@sourceware.org.
       This page was obtained from the project's upstream Git repository
       ⟨git://sourceware.org/git/systemtap.git⟩ on 2024-06-14.  (At that
       time, the date of the most recent commit that was found in the
       repository was 2024-06-13.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       man-pages@man7.org

SystemTap Tapset Reference     April 2024         FUNCTION::CTIME(3stap)

Pages that refer to this page: tapset::ctime(3stap)