Time
time
Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds.
Type:
() -> float
time.local
Convert a time in seconds into a date in the local time zone (current time is used if no argument is provided).
Type:
(?float?) -> unit
Arguments:
(unlabeled)(of typefloat?, which defaults tonull)
Methods:
day(of typeint): Day of month.dst(of typebool): Daylight time savings in effect.hour(of typeint): Hours.min(of typeint): Minutes.month(of typeint): Month of year.sec(of typeint): Seconds.week_day(of typeint): Day of week (Sunday is 0 or 7, Saturday is 6).year(of typeint): Year.year_day(of typeint): Day of year, between1and366.
time.make
Convert a date and time in the local timezone into a time, in seconds, since 00:00:00 GMT, Jan. 1, 1970.
Type:
(
{
day : int,
dst : bool?,
hour : int,
min : int,
month : int,
sec : int,
year : int
}) -> float
Arguments:
(unlabeled)(of type{ day : int, dst : bool?, hour : int, min : int, month : int, sec : int, year : int })
time.predicate
Parse a string as a time predicate
Type:
(string) -> () -> bool
Arguments:
(unlabeled)(of typestring)
time.string
Obtain a string representation of the current time. It takes a string as argument where special strings are replaced roughly following strftime: %H is replaced by the current hour, %M minute, %S second, %A week day (%a week day abbreviated), %d month day, %B month name (%b month name abbreviated), %z timezone.
Type:
(?time : float?, ?string?) -> string
Example:
s = time.string("Current time is %H:%M.")
print(s)
Example:
# Backup a source naming the file based on time
output.file({time.string("/path/to/file%H%M%S.wav")}, ...)
Arguments:
time(of typefloat?, which defaults tonull): If specified convert the given time (in seconds since 00:00:00 GMT, Jan. 1, 1970) instead of the current time.(unlabeled)(of typestring?, which defaults tonull): Description of the string to produce, e.g."Current time is %H:%M"`.
time.up
Current time, in seconds, since the script has started.
Type:
() -> float
time.utc
Convert a time in seconds into a date in the UTC time zone (current time is used if no argument is provided).
Type:
(?float?) -> unit
Arguments:
(unlabeled)(of typefloat?, which defaults tonull)
Methods:
day(of typeint): Day of month.dst(of typebool): Daylight time savings in effect.hour(of typeint): Hours.min(of typeint): Minutes.month(of typeint): Month of year.sec(of typeint): Seconds.week_day(of typeint): Day of week (Sunday is 0 or 7, Saturday is 6).year(of typeint): Year.year_day(of typeint): Day of year, between1and366.
time.zone
Returns a description of the time zone set for the running process.
Type:
() -> string
Methods:
daylight(of typestring): Daylight Savings Timeutc_diff(of typeint): Difference in seconds between the current timezone and UTC.
time.zone.set
Set the current time zone. This is equivalent to setting the TZ environment variable.
Type:
(string) -> unit
Arguments:
(unlabeled)(of typestring)