Date and Time Functions
AMPS includes functions for working with date and time values. This section covers functions loaded into AMPS by default. AMPS also includes functions for working with date and time in the Legacy Messaging Compatibility layer.
STRFTIME
format string, timestamp
Produces a string that contains a representation of the provided timestamp
, formatted as specified in the provided format string
. The format string uses the same format specifiers as the standard strftime(3)
function.
This function also supports the additional format specifier %f
to format microseconds, and the format specifier %03f
to format milliseconds.
The length of the string produced for the time is limited to 128 bytes.
STRPTIME
time string, format string
This function interprets the time string
provided as a timestamp, with the format string
specifying how to interpret the time string
.
This function returns a double.
The format string uses the same format specifiers as the standard strptime(3)
function.
This function also supports the additional format specifier %f
to parse microseconds, and the format specifier %03f
to parse milliseconds.
UNIX_TIMESTAMP
none
Returns the current timestamp as a double, represented in seconds (including parts of a second as a decimal).
Notice that a UNIX timestamp is seconds elapsed since 00:00 on January 1, 1970 in UTC and is independent of the timezone of the local system.
The underlying system call used for this function has microsecond resolution, subject to any hardware or host limitations.
This function is non-deterministic, and cannot be used in contexts that require a deterministic function
Last updated