FUNCTION::CTIME(3stap)
π FUNCTION::CTIME π
okay bestie, so this is a page out of the Time utility functions tapset in 3stap, and it's literally just about turning raw epoch seconds into a date a human can actually read. no cap. let's get into it π°οΈβ¨
β¨ NAME β¨
function::ctime β Convert seconds since epoch into human readable date/time string
π SYNOPSIS π
1) ctime:string(epochsecs:long)
2) ctime:string()
two flavors, babe. one takes an argument, one doesn't. pick your fighter π
πΈ ARGUMENTS πΈ
epochsecsβ Number of seconds since epoch (as returned bygettimeofday_s). that's it, that's the whole arg π«Ά
π¦ DESCRIPTION π¦
- Takes an argument of seconds since the epoch as returned by
gettimeofday_s. Returns a string of the form:
"Wed Jun 30 21:49:08 1993"
- The no-arg version is the same idea, just vibing without you handing it a number.
The string will always be exactly 24 characters. no more, no less, it's giving consistent. π
β οΈ okay so heads up: if the time would be unreasonable far in the past β like, before what can be represented with a 32 bit offset in seconds from the epoch β an error will occur. and if the time would be unreasonable far in the future, an error will also occur. you can dodge the past one with try/catch if you're built different like that. π
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"
those two are the actual edges of the 32-bit universe, bestie. it's giving bookends. πβ¨
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. so like, don't go comparing them and being confused, they are not the same girl. π
Also note that since the kernel has no concept of timezones, the returned time is always in GMT. every time. no exceptions. periodt. π
π SEE ALSO π
and that's the whole page, bestie, you ate that π go convert some seconds into a cute little string and live your main character era. no notes. π¦
SystemTap Tapset Reference β Version and date check: September 2026, so this page is lowkey iconic and also very much from the future. mwah π π
π¦ where this page comes from
- centos-stream 10: systemtap-client 5.6-3.el10 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- centos-stream 9: systemtap-client 5.6-3.el9 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- fedora 43: systemtap-client 5.6-1.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- fedora 44: systemtap-client 5.6-1.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms