Return to index

date functions

string = date([integer])

top

Returns a date/time string (RFC3339 format). Optional integer defaults to the current date/time, otherwise must be an epoch timestamp.


string = date_human([integer])

top

Returns the current date and time in a readable format (RFC822Z).

[#SOL]If optional integer present, uses that as the epoch timestamp to convert.


integer = epoch_nano_time([string])

top

Returns the current epoch (Unix) time in nano-seconds.


integer = epoch_time([string])

top

Returns the current epoch (Unix) time in seconds. If the optional string is present, then this is converted to epoch int format from RFC3339 format.


string = format_date([epoch])

top

Format date as string from current time or epoch.


string = format_time([epoch])

top

Format time as string from current time or epoch.


integer = now()

top

Returns the current epoch (Unix) time in seconds.


integer = time_diff(te,ts)

top

Returns difference in micro-seconds between two nano-epoch dates.


integer = time_dom([epochnano])

top

Returns the current day of the month (no arguments) or the day of the epoch nano time specified in epochnano.


string = time_dow([epochnano])

top

Returns the current day of the week (no arguments) or the day of the epoch nano time specified in epochnano.


integer = time_hours([epochnano])

top

Returns the current hour of the day (no arguments) or the hour of the day specified by the epoch nano time in epochnano.

Example:

now=epoch_nano_time()
println format( "%02d:%02d.%02d off_ns %d", time_hours(now), time_minutes(now), time_seconds(now), time_nanos(now) )
println format( "%s %02d-%02d-%04d", time_dow(now), time_dom(now), time_month(now), time_year(now) )


integer = time_minutes([epochnano])

top

Returns the current minute of the day (no arguments) or the minute of the day specified by the epoch nano time in epochnano.


integer = time_month([epochnano])

top

Returns the current month of the year (no arguments) or the month of the epoch nano time specified in epochnano.


integer = time_nanos([epochnano])

top

Returns the offset within the current second, in nanoseconds, (no arguments) or the

offset within the epoch nano time specified in epochnano.


integer = time_seconds([epochnano])

top

Returns the current second of the day (no arguments) or the second of the day specified by

the epoch nano time in epochnano.


integer = time_year([epochnano])

top

Returns the current year (no arguments) or the year of the epoch nano time specified in epochnano.


string = time_zone([integer])

top

Returns the time zone.


integer = time_zone_offset([integer])

top

Returns the time zone offset in seconds.