* Generated by setuputil.sno setup.makeinclude() 04/30/2025 15:14:37
	TIME_DL = "time"
	LOAD("GETTIMEOFDAY_(TIMEVAL)", TIME_DL)
	LOAD("LOCALTIME_(INTEGER,TM)", TIME_DL)
	LOAD("GMTIME_(INTEGER,TM)", TIME_DL)
	LOAD("STRFTIME(STRING,TM)STRING", TIME_DL)
	LOAD("MKTIME(TM)INTEGER", TIME_DL)
	LOAD("SLEEP(REAL)", TIME_DL)
	LOAD("STRPTIME_(STRING,STRING,TM)", TIME_DL)
	LOAD("TIMEGM(TM)INTEGER", TIME_DL)
**** funcs.sno:
* $Id: funcs.sno,v 1.3 2020-10-01 05:52:38 phil Exp $
*
* Phil Budne <phil@ultimate.com>
* December 15, 2010
*
* date/time functions

**=pea
**=sect NAME
**snobol4time \- SNOBOL4 time functions
**
**=sect SYNOPSIS
**=code
**-INCLUDE 'time.sno'
**=ecode
**
**=sect DESCRIPTION
**=item B<GETTIMEOFDAY()>
**function returns a B<DATA()> object of type B<TIMEVAL> with members
**B<TV_SEC> (seconds since 1/1/1970 GMT)
**and B<TV_NSEC> (nanoseconds since start of day I<starting in CSNOBOL4 2.2>).
**For compatibility with older versions of CSNOBOL,
* B<TV_USEC> contains microseconds since start of day).
**=cut
	DATA("TIMEVAL(TV_SEC,TV_USEC,TV_NSEC)")
	DEFINE("GETTIMEOFDAY()TIMEVAL")	:(E.GETTIMEOFDAY)
GETTIMEOFDAY
	GETTIMEOFDAY = TIMEVAL()
	GETTIMEOFDAY_(GETTIMEOFDAY)	:S(RETURN)F(FRETURN)
E.GETTIMEOFDAY

**=pea
**=item B<LOCALTIME(>I<sec>B<)>
**takes seconds since 1/1/1970, and returns a B<DATA()> object of type
**B<TM> with the following members:
**
**=cut

	DEFINE("LOCALTIME(T)TM")	:(E.LOCALTIME)
LOCALTIME
	LOCALTIME = TM()
	LOCALTIME_(T,LOCALTIME)		:S(RETURN)F(FRETURN)
E.LOCALTIME

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

	DATA("TM(TM_SEC,TM_MIN,TM_HOUR,TM_MDAY,TM_MON,"
+		"TM_YEAR,TM_WDAY,TM_YDAY,TM_ISDST,TM_GMTOFF)")

****************

**=pea
**=item B<GMTIME(>I<sec>B<)>
**converts seconds to a B<TM> object, but without any local time zone adjustments.
**=cut
	DEFINE("GMTIME(T)TM")		:(E.GMTIME)
GMTIME	GMTIME = TM()
	GMTIME_(T,GMTIME)		:S(RETURN)F(FRETURN)
E.GMTIME

****************

**=pea
**=item B<MKTIME(>I<tm>B<)>
**converts the B<TM> object representing a date/time in the current
**timezone setting to seconds since 1/1/1970 UTC.
**
**=item B<TIMEGM(>I<tm>B<)>
**converts the B<TM> object representing a UTC date/time 
**to seconds since 1/1/1970 UTC.
**
**=item B<SLEEP(>I<fp_sec>B<)>
**suspends program execution for a number of (floating point) seconds.
**Not all platforms may support sleep, or sleep for fractional seconds.
**Sleep resolution may vary between platforms. May return failure if the
**system indicated the sleep time was less than the requested time.
**
**=item B<STRFTIME(>I<format>B<,>I<tm>B<)>
**formats the date information in tm according to the format string.
**Consult your local B<strftime>(3) manual page (or C runtime manual)
**for more details.
**=cut
	
****************

**=pea
**=item B<STRPTIME(>I<str>B<,>I<format>B<)>
**parses a string using using the supplied format and returns a B<TM>
**object with the parsed elements filled in.  Consult your local
**B<strptime>(3) manual page (or C runtime manual) for more details.
**=cut

	DEFINE("STRPTIME(S,F)TM")	:(E.STRPTIME)
STRPTIME
	STRPTIME = TM()
	STRPTIME_(S,F,STRPTIME)		:S(RETURN)F(FRETURN)
E.STRPTIME

**=pea
**=sect SEE ALSO
**B<snobol4>(1), B<ctime>(3), B<strftime>(3), B<strptime>(3)
**
**=sect AUTHOR
**Philip L. Budne
**=cut

******** end funcs.sno
**************** end time.sno
