C++ counterparts of SPL native functions that deal with time operations. More...
Enumerations |
|
enum | TimestampFormat { YYYYMMDDhhmmss, YYYY_MM_DD_hh_mm_ss, MM_DD_YYYY_hh_mm_ss, DD_MM_YYYY_hh_mm_ss, YYYY_MM_DD_hh_mm_ss_mmm, MM_DD_YYYY_hh_mm_ss_mmm, DD_MM_YYYY_hh_mm_ss_mmm } |
C++ counterparts of SPL native functions that deal with time operations.
Common operations:
Time Conversion Types Supported formats:
|
inline |
Create a timestamp.
secs | Number of seconds. |
nanos | Number of nanoseconds. |
|
inline |
Create a timestamp.
secs | Number of seconds. |
nanos | Number of nanoseconds. |
mid | Machine id. |
|
inline |
Compute the difference between two timestamps (in nanoseconds as int64).
ts1 | First timestamp. |
ts2 | Second timestamp. |
|
inline |
Compute the difference between two timestamps (in seconds as float64).
ts1 | First timestamp. |
ts2 | Second timestamp. |
|
inline |
Add a time difference to a timestamp (in seconds as float64).
ts | Start time. |
diff | Difference to add. |
|
inline |
Add a time difference to a timestamp (in nanoseconds as int64).
ts | Start time. |
diff | Difference to add. |
|
inline |
Extract the seconds from a timestamp.
t | Input timestamp. |
|
inline |
Extract the nanoseconds from a timestamp.
t | Input timestamp. |
|
inline |
Extract the machine id from a timestamp.
t | Input timestamp. |
SPL::decimal128 SPL::Functions::Time::toDecimal128 | ( | const SPL::timestamp & | ts | ) |
Convert a timestamp to a decimal128 value.
ts | Timestamp. |
SPL::timestamp SPL::Functions::Time::fromDecimal128 | ( | const SPL::decimal128 & | t | ) |
Convert a decimal128 value to a timestamp.
t | Time in seconds. |
SPL::int64 SPL::Functions::Time::getCPUCounterInNanoSeconds | ( | ) |
Obtain the CPU counter, which is an indication of relative time in nanoseconds.
SPL::timestamp SPL::Functions::Time::getTimestamp | ( | ) |
Get the current wall clock time.
SPLRuntimeException | If unable to create timestamp. |
SPL::float64 SPL::Functions::Time::getTimestampInSecs | ( | ) |
Get the current wall clock time in seconds (fractional).
SPLRuntimeException | If unable to create timestamp. |
void SPL::Functions::Time::time | ( | const SPL::timestamp & | time, |
SPL::Tuple & | result | ||
) |
Convert a timestamp to broken-down time (Sys.tm), using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
result | Output tuple (see Sys.tm) representing broken down time. |
void SPL::Functions::Time::time | ( | const SPL::timestamp & | time, |
const SPL::rstring & | tzone, | ||
SPL::Tuple & | result | ||
) |
Convert a timestamp to broken-down time (Sys.tm), using a specified timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
tzone | Timezone to use for conversion. |
result | Output tuple (see Sys.tm) representing broken down time in the specified timezone. |
void SPL::Functions::Time::gmtime | ( | const SPL::timestamp & | time, |
SPL::Tuple & | result | ||
) |
Convert a timestamp to broken-down time (Sys.tm) using UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
result | Output tuple (see Sys.tm) representing broken down time in UTC. |
SPL::timestamp SPL::Functions::Time::toTimestamp | ( | const SPL::Tuple & | time | ) |
Convert a broken-down time (Sys.tm) into a timestamp containing the time since the Epoch.
time | Broken-down time tuple. |
SPL::timestamp SPL::Functions::Time::toTimestamp | ( | const SPL::Tuple & | time, |
bool | defaultZone | ||
) |
Convert a broken-down time (Sys.tm) into a timestamp containing the time since the Epoch. Additional parameter to specify using default time zone
time | Broken-down time tuple. |
defaultZone | If 'true', then use default time zone. |
SPL::rstring SPL::Functions::Time::strftime | ( | const SPL::Tuple & | time, |
const SPL::rstring & | format | ||
) |
Convert broken-down time (Sys.tm) to a date and time string.
time | Broken-down time (Sys.tm) representing the desired time. |
format | Date and time format string (see man page for strptime). |
void SPL::Functions::Time::strptime | ( | const SPL::rstring & | dateTime, |
const SPL::rstring & | format, | ||
SPL::Tuple & | result, | ||
SPL::uint32 & | numCharsProcessed | ||
) |
Convert a date and time string to broken-down time (Sys.tm).
dateTime | String representation of date/time. |
format | Date and time format string (see man page for strptime). |
result | Broken-down time (Sys.tm) corresponding to the date and time string. |
numCharsProcessed | Number of characters successfully consumed from dateTime. |
SPL::uint32 SPL::Functions::Time::year | ( | const SPL::timestamp & | time | ) |
Extract the year from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::month | ( | const SPL::timestamp & | time | ) |
Extract the month from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::day | ( | const SPL::timestamp & | time | ) |
Extract the day of month from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::hour | ( | const SPL::timestamp & | time | ) |
Extract the hour from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::minute | ( | const SPL::timestamp & | time | ) |
Extract the minute from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::second | ( | const SPL::timestamp & | time | ) |
Extract the second from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::dayOfYear | ( | const SPL::timestamp & | time | ) |
Extract the day of year from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::dayOfWeek | ( | const SPL::timestamp & | time | ) |
Extract the day of week from the time, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmyear | ( | const SPL::timestamp & | time | ) |
Extract the year from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmmonth | ( | const SPL::timestamp & | time | ) |
Extract the month from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmday | ( | const SPL::timestamp & | time | ) |
Extract the day of month from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmhour | ( | const SPL::timestamp & | time | ) |
Extract the hour from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmminute | ( | const SPL::timestamp & | time | ) |
Extract the minute from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmsecond | ( | const SPL::timestamp & | time | ) |
Extract the second from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmdayOfYear | ( | const SPL::timestamp & | time | ) |
Extract the day of year from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::uint32 SPL::Functions::Time::gmdayOfWeek | ( | const SPL::timestamp & | time | ) |
Extract the day of week from the time, using the UTC timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::rstring SPL::Functions::Time::ctime | ( | const SPL::timestamp & | time | ) |
Convert a time value to a date and time string, using the current timezone.
time | Seconds since the Epoch (00:00:00 UTC, January 1, 1970). |
SPL::timestamp SPL::Functions::Time::timeStringToTimestamp | ( | const SPL::rstring & | dmy, |
const SPL::rstring & | hmsmilli, | ||
bool | useLocaleMonth | ||
) |
Converts date and time strings into a timestamp containing the time since the Epoch, using the current timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp() is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::timeStringToTimestamp | ( | const SPL::ustring & | dmy, |
const SPL::ustring & | hmsmilli, | ||
bool | useLocaleMonth | ||
) |
Converts date and time strings into a timestamp containing the time since the Epoch, using the current timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::timeStringToTimestamp | ( | const SPL::rstring & | dmy, |
const SPL::rstring & | hmsmilli, | ||
const SPL::rstring & | tmzone, | ||
bool | useLocaleMonth | ||
) |
Converts date and time strings into a timestamp containing the time since the Epoch, using the specified timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
tmzone | Time zone (e.g., "UTC"). |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::timeStringToTimestamp | ( | const SPL::ustring & | dmy, |
const SPL::ustring & | hmsmilli, | ||
const SPL::ustring & | tmzone, | ||
bool | useLocaleMonth | ||
) |
Converts date and time strings into a timestamp containing the time since the Epoch, using the specified timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
tmzone | Time zone (e.g., "UTC"). |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::toTimestamp | ( | const Enum & | ftype, |
const char * | str | ||
) |
Converts a date and time string into a timestamp containing the time since the Epoch, using the current time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
|
inline |
Converts a date and time string into a timestamp containing the time since the Epoch, using the current time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
|
inline |
Converts a date and time string into a timestamp containing the time since the Epoch, using the current time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
|
inline |
Converts a date and time string into a timestamp containing the time since the Epoch, using the current time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
SPL::timestamp SPL::Functions::Time::toTimestamp | ( | const Enum & | ftype, |
const char * | str, | ||
const char * | tmzone | ||
) |
Converts a date and time string into a timestamp containing the time since the Epoch, using the specified time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
tmzone | A string with the timezone. |
|
inline |
Converts a date and time string into a timestamp containing the time since the Epoch, using the specified time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
tmzone | A string with the timezone. |
|
inline |
Converts a date and time string into a timestamp containing the time since the Epoch, using the specified time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
tmzone | A string with the timezone. |
|
inline |
Converts a date and time string into a timestamp containing the time since the Epoch, using the specified time zone. Supported formats:
ftype | The format of the string (e.g., Sys.YYYY_MM_DD_hh_mm_ss_mmm). |
str | A string with the specified format. |
tmzone | A string with the timezone. |
SPL::timestamp SPL::Functions::Time::timeStringtoTimestamp | ( | const SPL::ustring & | dmy, |
const SPL::ustring & | hmsmilli, | ||
const SPL::ustring & | tmzone, | ||
bool | useLocaleMonth | ||
) |
DEPRECATED. Please replace with timeStringToTimestamp. Converts date and time strings into a timestamp containing the time since the Epoch, using the specified timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
tmzone | Time zone (e.g., "UTC"). |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::timeStringtoTimestamp | ( | const SPL::rstring & | dmy, |
const SPL::rstring & | hmsmilli, | ||
bool | useLocaleMonth | ||
) |
DEPRECATED. Please replace with timeStringToTimestamp. Converts date and time strings into a timestamp containing the time since the Epoch, using the current timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::timeStringtoTimestamp | ( | const SPL::ustring & | dmy, |
const SPL::ustring & | hmsmilli, | ||
bool | useLocaleMonth | ||
) |
DEPRECATED. Please replace with timeStringToTimestamp. Converts date and time strings into a timestamp containing the time since the Epoch, using the current timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |
SPL::timestamp SPL::Functions::Time::timeStringtoTimestamp | ( | const SPL::rstring & | dmy, |
const SPL::rstring & | hmsmilli, | ||
const SPL::rstring & | tmzone, | ||
bool | useLocaleMonth | ||
) |
DEPRECATED. Please replace with timeStringToTimestamp. Converts date and time strings into a timestamp containing the time since the Epoch, using the specified timezone.
dmy | A string with a format of the form "04-OCT-2005". |
hmsmilli | A string with a format of the form "14:18:19.324". |
tmzone | Time zone (e.g., "UTC"). |
useLocaleMonth | If 'true', current locale is used for month names. If 'false', C locale is assumed. Performance of timeStringToTimestamp is greater with useLocaleMonth == 'false'. |