1SNOBOL4TIME(3) CSNOBOL4 Manual SNOBOL4TIME(3)
2
3
4
6 snobol4time - SNOBOL4 time functions
7
9 -INCLUDE 'time.sno'
10
12 GETTIMEOFDAY()
13 function returns a DATA() object of type TIMEVAL with members
14 TV_SEC (seconds since 1/1/1970 GMT) and TV_NSEC (nanoseconds since
15 start of day starting in CSNOBOL4 2.2). For compatibility with
16 older versions of CSNOBOL,
17 TV_USEC contains microseconds since start of day).
18
19 LOCALTIME(sec)
20 takes seconds since 1/1/1970, and returns a DATA() object of type
21 TM with the following members:
22
23 • TM_SEC seconds since start of local minute (0 to 60)
24
25 • TM_MIN minutes since start of local hour (0 to 59)
26
27 • TM_HOUR hours since start of local day (0 to 23)
28
29 • TM_MDAY day of month (1 to 31)
30
31 • TM_MON month of year (0 to 11)
32
33 • TM_YEAR year minus 1900
34
35 • TM_WDAY day of week (sunday = 0)
36
37 • TM_YDAY day of year (0 to 365)
38
39 • TM_ISDST is non-zero if summer time in effect at that time
40
41 • TM_GMTOFF offset from UTC in seconds (or -1 if not available)
42
43 GMTIME(sec)
44 converts seconds to a TM object, but without any local time zone
45 adjustments.
46
47 MKTIME(tm)
48 converts the TM object representing a date/time in the current
49 timezone setting to seconds since 1/1/1970 UTC.
50
51 TIMEGM(tm)
52 converts the TM object representing a UTC date/time to seconds
53 since 1/1/1970 UTC.
54
55 SLEEP(fp_sec)
56 suspends program execution for a number of (floating point)
57 seconds. Not all platforms may support sleep, or sleep for
58 fractional seconds. Sleep resolution may vary between platforms.
59 May return failure if the system indicated the sleep time was less
60 than the requested time.
61
62 STRFTIME(format,tm)
63 formats the date information in tm according to the format string.
64 Consult your local strftime(3) manual page (or C runtime manual)
65 for more details.
66
67 STRPTIME(str,format)
68 parses a string using using the supplied format and returns a TM
69 object with the parsed elements filled in. Consult your local
70 strptime(3) manual page (or C runtime manual) for more details.
71
73 snobol4(1), ctime(3), strftime(3), strptime(3)
74
76 Philip L. Budne
77
78
79
80CSNOBOL4B 2.3.1 March 31, 2022 SNOBOL4TIME(3)