timecalc()
timecalc()
Section titled “timecalc()”timecalc(<timestring>[, <modifier>, ... ])
secscalc(<timestring>[, <modifier>, ... ])
Takes a time and returns the resulting time after applying any modifiers. timecalc() returns a time is the same format as time(), and secscalc() as the seconds since the epoch. These functions can deal with a much broader range of times than the other time functions.
<timestring> can be in the following formats:
YYYY-MM-DD
YYYY-MM-DD HH:MM
YYYY-MM-DD HH:MM:SS
YYYY-MM-DD HH:MM:SS.SSS
HH:MM
HH:MM:SS
HH:MM:SS.SSS
now (Current time in UTC)
An integer number of Unix seconds since 1970-01-01T00:00:00Z (with or without a unixepoch modifier). Numeric Julian-day input is not supported.
Time modifiers
Section titled “Time modifiers”<modifier>s can be in the following formats:
NNN days
NNN hours
NNN minutes
NNN.NNNN seconds
NNN months
NNN years
start of month
start of year
start of day
weekday N
unixepoch
localtime (Converts a UTC time to local time)
utc (Converts a local time to UTC)
The modifier vocabulary resembles SQLite date functions, but SharpMUSH parses numeric input as Unix seconds unconditionally; unixepoch therefore leaves an already parsed instant unchanged. Do not assume SQLite’s Julian-day numeric-input semantics.
Examples:
think timecalc(now, +100 years, localtime)Mon May 09 03:57:31 2118think timecalc(secs(), unixepoch)Wed May 09 12:19:21 2018