SNOBOL4TIME(3)

πŸ“¦
version 2.3.1 Β· 3 versions
, in fedora 43, fedora 44, opensuse-leap 16.0

✨ SNOBOL4TIME(3) ✨

okay bestie, welcome to the CSNOBOL4 manual, section 3, and today's main character is snobol4time β€” it's the page all about SNOBOL4's time functions πŸ’–


🌸 NAME 🌸

snobol4time β€” SNOBOL4 time functions ⏰✨


πŸŽ€ SYNOPSIS πŸŽ€

-INCLUDE 'time.sno'

like, that's the whole vibe. one include line and you're in 🫢


πŸ’… DESCRIPTION πŸ’…

okay so here's the roster, and every single one of these eats:

GETTIMEOFDAY() πŸ•°οΈ

this one returns a DATA() object of type TIMEVAL with these members:

  • TV_SEC β€” seconds since 1/1/1970 GMT ⭐
  • TV_NSEC β€” nanoseconds since start of day, starting in CSNOBOL4 2.2 🌈

and for compatibility with older versions of CSNOBOL:

  • TV_USEC contains microseconds since start of day πŸ’€ (yes, the docs really do say that)

LOCALTIME(sec) 🌍

takes seconds since 1/1/1970, and returns a DATA() object of type TM with the following members:

  • TM_SEC β€” seconds since start of local minute (0 to 60)
  • TM_MIN β€” minutes since start of local hour (0 to 59)
  • TM_HOUR β€” hours since start of local day (0 to 23)
  • TM_MDAY β€” day of month (1 to 31)
  • TM_MON β€” month of year (0 to 11)
  • TM_YEAR β€” year minus 1900
  • TM_WDAY β€” day of week (sunday = 0)
  • TM_YDAY β€” day of year (0 to 365)
  • TM_ISDST β€” is non-zero if summer time in effect at that time
  • TM_GMTOFF β€” offset from UTC in seconds (or -1 if not available)

GMTIME(sec) 🌐

converts seconds to a TM object, but without any local time zone adjustments. no local drama, just pure UTC energy ✨

MKTIME(tm) πŸ”

converts the TM object representing a date/time in the current timezone setting to seconds since 1/1/1970 UTC.

TIMEGM(tm) πŸ•›

converts the TM object representing a UTC date/time to seconds since 1/1/1970 UTC.

SLEEP(fp_sec) 😴

suspends program execution for a number of (floating point) seconds.

ngl bestie, this one is a little unhinged across platforms: not all platforms may support sleep, or sleep for fractional seconds. sleep resolution may vary between platforms. and it may return failure if the system indicated the sleep time was less than the requested time 😭

STRFTIME(format,tm) πŸ“

formats the date information in tm according to the format string. consult your local strftime(3) manual page (or C runtime manual) for more details πŸ‘‘

STRPTIME(str,format) πŸ”

parses a string using using the supplied format and returns a TM object with the parsed elements filled in. consult your local strptime(3) manual page (or C runtime manual) for more details πŸ’œ

(yes, "using using" β€” we keep the lore exactly as it was written, no cap 🫢)


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

Philip L. Budne πŸ’–


and that's the whole page, bestie!! this one's from CSNOBOL4B 2.3.1, dated March 31, 2022 β€” so it's vintage but still slaying, fr fr πŸŒΈβœ¨πŸ’…

πŸ“¦ where this page comes from