Time Shield Library
C++ library for working with time
|
A comprehensive set of functions and utilities for working with timestamps and time-related data. More...
Functions | |
template<class T = int> | |
constexpr const T | time_shield::ns_of_sec (fts_t ts) noexcept |
Get the nanosecond part of the second from a floating-point timestamp. | |
template<class T = int> | |
constexpr const T | time_shield::us_of_sec (fts_t ts) noexcept |
Get the microsecond part of the second from a floating-point timestamp. | |
template<class T = int> | |
constexpr const T | time_shield::ms_of_sec (fts_t ts) noexcept |
Get the millisecond part of the second from a floating-point timestamp. | |
template<class T = int> | |
constexpr const T | time_shield::ms_of_ts (ts_ms_t ts) noexcept |
Get the millisecond part of the timestamp. | |
template<class T > | |
constexpr const ts_ms_t | time_shield::sec_to_ms_impl (T t, std::true_type) noexcept |
template<class T > | |
constexpr const ts_ms_t | time_shield::sec_to_ms_impl (T t, std::false_type) noexcept |
template<class T1 = ts_ms_t, class T2 > | |
constexpr const T1 | time_shield::sec_to_ms (T2 ts) noexcept |
Converts a timestamp from seconds to milliseconds. | |
constexpr const ts_ms_t | time_shield::fsec_to_ms (fts_t ts) noexcept |
Converts a floating-point timestamp from seconds to milliseconds. | |
template<class T1 = ts_t, class T2 = ts_ms_t> | |
constexpr const T1 | time_shield::ms_to_sec (T2 ts_ms) noexcept |
Converts a timestamp from milliseconds to seconds. | |
template<class T = ts_ms_t> | |
constexpr const fts_t | time_shield::ms_to_fsec (T ts_ms) noexcept |
Converts a timestamp from milliseconds to floating-point seconds. | |
template<class T = year_t> | |
constexpr const T | time_shield::get_unix_year (ts_t ts) noexcept |
Converts a UNIX timestamp to a year. | |
template<class T = year_t> | |
constexpr const T | time_shield::unix_year (ts_t ts) noexcept |
Alias for get_unix_year function. | |
template<class T = year_t> | |
constexpr const T | time_shield::to_unix_year (ts_t ts) noexcept |
Alias for get_unix_year function. | |
template<class T = int> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::hour24_to_12 (T hour) noexcept |
Converts a 24-hour format hour to a 12-hour format. | |
template<class T = int> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::h24_to_h12 (T hour) noexcept |
Alias for hour24_to_12 function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_timestamp (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0) |
Converts a date and time to a timestamp. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_ts (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0) |
Alias for to_timestamp function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::get_ts (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0) |
Alias for to_timestamp function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::ts (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0) |
Alias for to_timestamp function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::timestamp (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0) |
Alias for to_timestamp function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::get_timestamp (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0) |
Alias for to_timestamp function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::tm_to_timestamp (const std::tm *timeinfo) |
Converts a std::tm structure to a timestamp. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_timestamp (const std::tm *timeinfo) |
Alias for tm_to_timestamp function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_ts (const std::tm *timeinfo) |
Alias for tm_to_timestamp function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::ts (const std::tm *timeinfo) |
Alias for tm_to_timestamp function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::timestamp (const std::tm *timeinfo) |
Alias for tm_to_timestamp function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::ts_from_tm (const std::tm *timeinfo) |
Alias for tm_to_timestamp function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::to_timestamp_ms (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T2 ms=0) |
Converts a date and time to a timestamp in milliseconds. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::to_ts_ms (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T2 ms=0) |
Alias for to_timestamp_ms function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::ts_ms (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T2 ms=0) |
Alias for to_timestamp_ms function. | |
template<class T1 = year_t, class T2 = int> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::timestamp_ms (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T2 ms=0) |
Alias for to_timestamp_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::tm_to_timestamp_ms (const std::tm *timeinfo) |
Converts a std::tm structure to a timestamp in milliseconds. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_timestamp_ms (const std::tm *timeinfo) |
Alias for tm_to_timestamp_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_ts_ms (const std::tm *timeinfo) |
Alias for tm_to_timestamp_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::ts_ms (const std::tm *timeinfo) |
Alias for tm_to_timestamp_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::timestamp_ms (const std::tm *timeinfo) |
Alias for tm_to_timestamp_ms function. | |
template<class T1 = year_t, class T2 = int, class T3 = int> | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::to_ftimestamp (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T3 ms=0) |
Converts a date and time to a floating-point timestamp. | |
template<class T1 = year_t, class T2 = int, class T3 = int> | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::to_fts (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T3 ms=0) |
Alias for to_ftimestamp function. | |
template<class T1 = year_t, class T2 = int, class T3 = int> | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::fts (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T3 ms=0) |
Alias for to_ftimestamp function. | |
template<class T1 = year_t, class T2 = int, class T3 = int> | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::ftimestamp (T1 year, T2 month, T2 day, T2 hour=0, T2 min=0, T2 sec=0, T3 ms=0) |
Alias for to_ftimestamp function. | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::tm_to_ftimestamp (const std::tm *timeinfo) |
Converts a std::tm structure to a floating-point timestamp. | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::to_ftimestamp (const std::tm *timeinfo) |
Alias for tm_to_ftimestamp function. | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::to_fts (const std::tm *timeinfo) |
Alias for tm_to_ftimestamp function. | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::fts (const std::tm *timeinfo) |
Alias for tm_to_ftimestamp function. | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::ftimestamp (const std::tm *timeinfo) |
Alias for tm_to_ftimestamp function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::get_unix_day (ts_t ts=ts()) noexcept |
Get UNIX day. | |
template<class T = uday_t> | |
constexpr const T | time_shield::get_unixday (ts_t ts=ts()) noexcept |
Alias for get_unix_day function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::unix_day (ts_t ts=ts()) noexcept |
Alias for get_unix_day function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::unixday (ts_t ts=ts()) noexcept |
Alias for get_unix_day function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::uday (ts_t ts=ts()) noexcept |
Alias for get_unix_day function. | |
template<class T = int> | |
constexpr const T | time_shield::get_days_difference (ts_t start, ts_t stop) noexcept |
Get the number of days between two timestamps. | |
template<class T = int> | |
constexpr const T | time_shield::get_days (ts_t start, ts_t stop) noexcept |
Alias for get_days_difference function. | |
template<class T = int> | |
constexpr const T | time_shield::days (ts_t start, ts_t stop) noexcept |
Alias for get_days_difference function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::get_unix_day_ms (ts_ms_t t_ms=ts_ms()) noexcept |
Get UNIX day from milliseconds timestamp. | |
template<class T = uday_t> | |
constexpr const T | time_shield::get_unixday_ms (ts_ms_t t_ms=ts_ms()) noexcept |
Alias for get_unix_day_ms function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::unix_day_ms (ts_ms_t t_ms=ts_ms()) noexcept |
Alias for get_unix_day_ms function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::unixday_ms (ts_ms_t t_ms=ts_ms()) noexcept |
Alias for get_unix_day_ms function. | |
template<class T = uday_t> | |
constexpr const T | time_shield::uday_ms (ts_ms_t t_ms=ts_ms()) noexcept |
Alias for get_unix_day_ms function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::unix_day_to_timestamp (uday_t unix_day) noexcept |
Converts a UNIX day to a timestamp in seconds. | |
template<class T = ts_t> | |
constexpr const T | time_shield::unix_day_to_ts (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::unixday_to_ts (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::uday_to_ts (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::start_of_day_from_unix_day (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::unix_day_to_timestamp_ms (uday_t unix_day) noexcept |
Converts a UNIX day to a timestamp in milliseconds. | |
template<class T = ts_t> | |
constexpr const T | time_shield::unix_day_to_ts_ms (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp_ms function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::unixday_to_ts_ms (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp_ms function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::uday_to_ts_ms (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp_ms function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::start_of_day_from_unix_day_ms (uday_t unix_day) noexcept |
Alias for unix_day_to_timestamp_ms function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::end_of_day_from_unix_day (uday_t unix_day) noexcept |
Converts a UNIX day to a timestamp representing the end of the day in seconds. | |
template<class T = ts_ms_t> | |
constexpr const T | time_shield::end_of_day_from_unix_day_ms (uday_t unix_day) noexcept |
Converts a UNIX day to a timestamp representing the end of the day in milliseconds. | |
template<class T = ts_ms_t> | |
constexpr const T | time_shield::start_of_next_day_from_unix_day (uday_t unix_day) noexcept |
Converts a UNIX day to a timestamp representing the start of the next day in seconds. | |
template<class T = ts_ms_t> | |
constexpr const T | time_shield::start_of_next_day_from_unix_day_ms (uday_t unix_day) noexcept |
Converts a UNIX day to a timestamp representing the start of the next day in milliseconds. | |
template<class T = ts_t> | |
constexpr const T | time_shield::next_day_from_unix_day (uday_t unix_day) noexcept |
Alias for start_of_next_day_from_unix_day function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::next_day_unix_day (uday_t unix_day) noexcept |
Alias for start_of_next_day_from_unix_day function. | |
template<class T = ts_t> | |
constexpr const T | time_shield::next_day_unixday (uday_t unix_day) noexcept |
Alias for start_of_next_day_from_unix_day function. | |
template<class T = ts_ms_t> | |
constexpr const T | time_shield::next_day_from_unix_day_ms (uday_t unix_day) noexcept |
Alias for start_of_next_day_from_unix_day_ms function. | |
template<class T = ts_ms_t> | |
constexpr const T | time_shield::next_day_unix_day_ms (uday_t unix_day) noexcept |
Alias for start_of_next_day_from_unix_day_ms function. | |
template<class T = ts_ms_t> | |
constexpr const T | time_shield::next_day_unixday_ms (uday_t unix_day) noexcept |
Alias for start_of_next_day_from_unix_day_ms function. | |
template<class T = int64_t> | |
constexpr const T | time_shield::get_unix_min (ts_t ts=ts()) |
Get UNIX minute. | |
template<class T = int64_t> | |
constexpr const T | time_shield::unix_min (ts_t ts=ts()) |
Alias for get_unix_min function. | |
template<class T = int64_t> | |
constexpr const T | time_shield::to_unix_min (ts_t ts=ts()) |
Alias for get_unix_min function. | |
template<class T = int64_t> | |
constexpr const T | time_shield::umin (ts_t ts=ts()) |
Alias for get_unix_min function. | |
template<class T = int> | |
constexpr const T | time_shield::sec_of_day (ts_t ts=ts()) noexcept |
Get the second of the day. | |
template<class T = int> | |
constexpr const T | time_shield::sec_of_day_ms (ts_ms_t ts_ms) noexcept |
Get the second of the day from milliseconds timestamp. | |
template<class T1 = int, class T2 = int> | |
constexpr const T1 | time_shield::sec_of_day (T2 hour, T2 min, T2 sec) noexcept |
Get the second of the day. | |
template<class T = int> | |
constexpr const T | time_shield::sec_of_min (ts_t ts=ts()) |
Get the second of the minute. | |
template<class T = int> | |
constexpr const T | time_shield::sec_of_hour (ts_t ts=ts()) |
Get the second of the hour. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::get_year (ts_t ts=ts()) |
Get the year from the timestamp. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::year (ts_t ts=ts()) |
Alias for get_year function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::to_year (ts_t ts=ts()) |
Alias for get_year function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::get_year_ms (ts_ms_t ts_ms=ts_ms()) |
Get the year from the timestamp in milliseconds. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::year_ms (ts_ms_t ts_ms=ts_ms()) |
Alias for get_year_ms function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::to_year_ms (ts_ms_t ts_ms=ts_ms()) |
Alias for get_year_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::start_of_year (ts_t ts) noexcept |
Get the start of the year timestamp. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_start (ts_t ts=ts()) |
Alias for start_of_year function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_begin (ts_t ts=ts()) |
Alias for start_of_year function. | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::start_of_year_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the start of the year timestamp in milliseconds. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_start_ms (ts_t ts_ms=ts_ms()) |
Alias for start_of_year_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_begin_ms (ts_t ts_ms=ts_ms()) |
Alias for start_of_year_ms function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::start_of_year_date (T year) |
Get the timestamp of the start of the year. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_start_date (T year) |
Alias for start_of_year_date function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_begin_date (T year) |
Alias for start_of_year_date function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::start_of_year_date_ms (T year) |
Get the timestamp in milliseconds of the start of the year. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::year_start_date_ms (T year) |
Alias for start_of_year_date_ms function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::year_begin_date_ms (T year) |
Alias for start_of_year_date_ms function. | |
TIME_SHIELD_CONSTEXPR ts_t | time_shield::end_of_year (ts_t ts=ts()) |
Get the end-of-year timestamp. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::year_end (ts_t ts=ts()) |
Alias for end_of_year function. | |
template<class T = year_t> | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::end_of_year_ms (ts_ms_t ts_ms=ts_ms()) |
Get the timestamp in milliseconds of the end of the year. | |
TIME_SHIELD_CONSTEXPR const ts_ms_t | time_shield::year_end_ms (ts_ms_t ts_ms=ts_ms()) |
Alias for end_of_year_ms function. | |
template<class T = int> | |
const T | time_shield::day_of_year (ts_t ts=ts()) |
Get the day of the year. | |
template<class T = Month> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::month_of_year (ts_t ts) noexcept |
Get the month of the year. | |
template<class T = int> | |
TIME_SHIELD_CONSTEXPR const T | time_shield::day_of_month (ts_t ts) |
Get the day of the month. | |
template<class T1 = int, class T2 = year_t, class T3 = int> | |
constexpr const T1 | time_shield::num_days_in_month (T2 year, T3 month) noexcept |
Get the number of days in a month. | |
template<class T1 = int, class T2 = year_t, class T3 = int> | |
constexpr const T1 | time_shield::days_in_month (T2 year, T3 month) noexcept |
Alias for num_days_in_month function. | |
template<class T1 = int> | |
TIME_SHIELD_CONSTEXPR const T1 | time_shield::num_days_in_month_ts (ts_t ts=ts()) noexcept |
Get the number of days in the month of the given timestamp. | |
template<class T1 = int> | |
constexpr const T1 | time_shield::num_days_in_month (ts_t ts=ts()) noexcept |
Alias for num_days_in_month_ts function. | |
template<class T1 = int> | |
constexpr const T1 | time_shield::days_in_month (ts_t ts=ts()) noexcept |
Alias for num_days_in_month_ts function. | |
template<class T1 = int, class T2 = year_t> | |
constexpr const T1 | time_shield::num_days_in_year (T2 year) noexcept |
Get the number of days in a given year. | |
template<class T1 = int, class T2 = year_t> | |
constexpr const T1 | time_shield::days_in_year (T2 year) noexcept |
Alias for num_days_in_year function. | |
template<class T = int> | |
constexpr const T | time_shield::num_days_in_year_ts (ts_t ts=ts()) |
Get the number of days in the current year. | |
template<class T = int> | |
constexpr const T | time_shield::days_in_year_ts (ts_t ts=ts()) |
Alias for num_days_in_year_ts function. | |
constexpr const ts_t | time_shield::start_of_day (ts_t ts=ts()) noexcept |
Get the start of the day timestamp. | |
constexpr const ts_t | time_shield::day_start (ts_t ts=ts()) noexcept |
Alias for start_of_day function. | |
template<class T = int> | |
constexpr const ts_t | time_shield::start_of_prev_day (ts_t ts=ts(), T days=1) noexcept |
Get timestamp of the start of the previous day. | |
template<class T = int> | |
constexpr const ts_t | time_shield::previous_day_start (ts_t ts=ts(), T days=1) noexcept |
Alias for start_of_prev_day function. | |
constexpr const ts_t | time_shield::start_of_day_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the start of the day timestamp in seconds. | |
constexpr const ts_t | time_shield::day_start_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for start_of_day_sec function. | |
constexpr const ts_ms_t | time_shield::start_of_day_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the start of the day timestamp in milliseconds. | |
constexpr const ts_ms_t | time_shield::day_start_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for start_of_day_ms function. | |
template<class T = int> | |
constexpr const ts_t | time_shield::start_of_next_day (ts_t ts, T days=1) noexcept |
Get the timestamp of the start of the day after a specified number of days. | |
template<class T = int> | |
constexpr const ts_t | time_shield::next_day_start (ts_t ts, T days=1) noexcept |
Alias for start_of_next_day function. | |
template<class T = int> | |
constexpr const ts_ms_t | time_shield::start_of_next_day_ms (ts_ms_t ts_ms, T days=1) noexcept |
Get the timestamp of the start of the day after a specified number of days. | |
template<class T = int> | |
constexpr const ts_ms_t | time_shield::next_day_start_ms (ts_ms_t ts_ms, T days=1) noexcept |
Alias for start_of_next_day_ms function. | |
template<class T = int> | |
constexpr const ts_t | time_shield::next_day (ts_t ts, T days=1) noexcept |
Calculate the timestamp for a specified number of days in the future. | |
template<class T = int> | |
constexpr const ts_ms_t | time_shield::next_day_ms (ts_ms_t ts_ms, T days=1) noexcept |
Calculate the timestamp for a specified number of days in the future (milliseconds). | |
constexpr const ts_t | time_shield::end_of_day (const ts_t &ts=ts()) noexcept |
Get the timestamp at the end of the day. | |
constexpr const ts_t | time_shield::day_end (const ts_t &ts=ts()) noexcept |
Alias for end_of_day function. | |
constexpr const ts_t | time_shield::end_of_day_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the timestamp at the end of the day in seconds. | |
constexpr const ts_t | time_shield::day_end_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for end_of_day_sec function. | |
constexpr const ts_ms_t | time_shield::end_of_day_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the timestamp at the end of the day in milliseconds. | |
constexpr const ts_ms_t | time_shield::day_end_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for end_of_day_ms function. | |
template<class T1 = Weekday, class T2 = year_t, class T3 = int> | |
constexpr const T1 | time_shield::day_of_week_date (T2 year, T3 month, T3 day) |
Get the day of the week. | |
template<class T1 = Weekday, class T2 = year_t, class T3 = int> | |
constexpr const T1 | time_shield::get_weekday (T2 year, T3 month, T3 day) |
Alias for day_of_week_date function. | |
template<class T1 = Weekday, class T2 = year_t, class T3 = int> | |
constexpr const T1 | time_shield::day_of_week (T2 year, T3 month, T3 day) |
Alias for day_of_week_date function. | |
template<class T = Weekday> | |
constexpr const T | time_shield::get_weekday_from_ts (ts_t ts) noexcept |
Get the weekday from a timestamp. | |
template<class T = Weekday> | |
constexpr const T | time_shield::day_of_week (ts_t ts) noexcept |
Alias for get_weekday_from_ts function. | |
template<class T = Weekday> | |
constexpr const T | time_shield::get_weekday_from_ts_ms (ts_ms_t ts_ms) |
Get the weekday from a timestamp in milliseconds. | |
template<class T = Weekday> | |
constexpr const T | time_shield::day_of_week_ms (const ts_ms_t &ts_ms) |
Alias for get_weekday_from_ts_ms function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::start_of_month (ts_t ts=ts()) |
Get the timestamp at the start of the current month. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::month_begin (ts_t ts=ts()) |
Alias for start_of_month function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::end_of_month (ts_t ts=ts()) |
Get the last timestamp of the current month. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::last_day_of_month (ts_t ts=ts()) |
Alias for end_of_month function. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::last_sunday_of_month (ts_t ts=ts()) |
Get the timestamp of the last Sunday of the current month. | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::final_sunday_of_month (ts_t ts=ts()) |
Alias for last_sunday_of_month function. | |
template<class T1 = int, class T2 = year_t, class T3 = int> | |
TIME_SHIELD_CONSTEXPR const T1 | time_shield::last_sunday_month_day (T2 year, T3 month) |
Get the day of the last Sunday of the given month and year. | |
template<class T1 = int, class T2 = year_t, class T3 = int> | |
TIME_SHIELD_CONSTEXPR const T1 | time_shield::final_sunday_month_day (T2 year, T3 month) |
Alias for last_sunday_month_day function. | |
constexpr const ts_t | time_shield::start_of_hour (ts_t ts=ts()) noexcept |
Get the timestamp at the start of the hour. | |
constexpr const ts_t | time_shield::hour_begin (ts_t ts=ts()) noexcept |
Alias for start_of_hour function. | |
constexpr const ts_t | time_shield::start_of_hour_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the timestamp at the start of the hour. | |
constexpr const ts_t | time_shield::hour_begin_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for start_of_hour_sec function. | |
constexpr const ts_ms_t | time_shield::start_of_hour_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the timestamp at the start of the hour. This function sets the minute and second to zero. | |
constexpr const ts_ms_t | time_shield::hour_begin_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for start_of_hour_ms function. | |
constexpr const ts_t | time_shield::end_of_hour (ts_t ts=ts()) noexcept |
Get the timestamp at the end of the hour. This function sets the minute and second to 59. | |
constexpr const ts_t | time_shield::finish_of_hour (ts_t ts=ts()) noexcept |
Alias for end_of_hour function. | |
constexpr const ts_t | time_shield::end_of_hour_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the timestamp at the end of the hour. | |
constexpr const ts_t | time_shield::finish_of_hour_sec (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for end_of_hour_sec function. | |
constexpr const ts_ms_t | time_shield::end_of_hour_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Get the timestamp at the end of the hour. | |
constexpr const ts_ms_t | time_shield::finish_of_hour_ms (ts_ms_t ts_ms=ts_ms()) noexcept |
Alias for end_of_hour_ms function. | |
template<class T = int> | |
constexpr const T | time_shield::hour_of_day (ts_t ts=ts()) noexcept |
Get the hour of the day. | |
template<class T = int> | |
constexpr const T | time_shield::hour_in_day (ts_t ts=ts()) noexcept |
Alias for hour_of_day function. | |
constexpr const ts_t | time_shield::start_of_week (ts_t ts=ts()) |
Get the timestamp of the beginning of the week. | |
constexpr const ts_t | time_shield::week_begin (ts_t ts=ts()) |
Alias for start_of_week function. | |
constexpr const ts_t | time_shield::end_of_week (ts_t ts=ts()) |
Get the timestamp of the end of the week. | |
constexpr const ts_t | time_shield::finish_of_week (ts_t ts=ts()) |
Alias for end_of_week function. | |
constexpr const ts_t | time_shield::start_of_saturday (ts_t ts=ts()) |
Get the timestamp of the start of Saturday. | |
constexpr const ts_t | time_shield::saturday_begin (ts_t ts=ts()) |
Alias for start_of_saturday function. | |
constexpr const ts_t | time_shield::start_of_min (ts_t ts=ts()) noexcept |
Get the timestamp of the beginning of the minute. | |
constexpr const ts_t | time_shield::min_begin (ts_t ts=ts()) noexcept |
Alias for start_of_min function. | |
constexpr const ts_t | time_shield::end_of_min (ts_t ts=ts()) noexcept |
Get the timestamp of the end of the minute. | |
constexpr const ts_t | time_shield::finish_of_min (ts_t ts=ts()) noexcept |
Alias for end_of_min function. | |
template<class T = int> | |
constexpr const T | time_shield::min_of_day (ts_t ts=ts()) noexcept |
Get minute of day. This function returns a value between 0 to 1439 (minute of day). | |
template<class T = int> | |
constexpr const T | time_shield::min_of_hour (ts_t ts=ts()) noexcept |
Get minute of hour. This function returns a value between 0 to 59. | |
template<class T = int> | |
constexpr const ts_t | time_shield::start_of_period (T p, ts_t ts=ts()) |
Get the timestamp of the start of the period. | |
template<class T = int> | |
constexpr const ts_t | time_shield::end_of_period (T p, ts_t ts=ts()) |
Get the timestamp of the end of the period. | |
template<class T = TimeZoneStruct> | |
const TimeZoneStruct | time_shield::to_time_zone (tz_t offset) |
Converts an integer to a time zone structure. | |
const TimeZoneStruct | time_shield::to_time_zone_struct (tz_t offset) |
Converts an integer to a TimeZoneStruct. | |
const TimeZoneStruct | time_shield::to_tz (tz_t offset) |
Alias for to_time_zone_struct function. | |
const tz_t | time_shield::time_zone_struct_to_offset (const TimeZoneStruct &tz) |
Converts a TimeZoneStruct to a single integer representation. | |
const tz_t | time_shield::tz_to_offset (const TimeZoneStruct &tz) |
Alias for time_zone_struct_to_offset function. | |
const tz_t | time_shield::to_offset (const TimeZoneStruct &tz) |
Alias for time_zone_struct_to_offset function. | |
A comprehensive set of functions and utilities for working with timestamps and time-related data.
This module provides functionalities to convert, manipulate, and analyze timestamps in seconds, milliseconds, and floating-point formats. It also includes utilities for working with date-time structures, UNIX days, and various time units (hours, minutes, seconds, etc.).
Alias for end_of_day function.
Get the timestamp at the end of the day.
This function sets the hour to 23, minute to 59, and second to 59.
ts | Timestamp. |
Definition at line 2016 of file time_conversions.hpp.
Alias for end_of_day_ms function.
Get the timestamp at the end of the day in milliseconds.
This function sets the hour to 23, minute to 59, second to 59, and millisecond to 999.
ts_ms | Timestamp in milliseconds. |
Definition at line 2052 of file time_conversions.hpp.
Alias for end_of_day_sec function.
Get the timestamp at the end of the day in seconds.
This function sets the hour to 23, minute to 59, and second to 59.
ts_ms | Timestamp in milliseconds. |
Definition at line 2034 of file time_conversions.hpp.
|
inline |
Get the day of the month.
This function returns the day of the month for the specified timestamp.
ts | Timestamp. |
Definition at line 1727 of file time_conversions.hpp.
|
constexpr |
Alias for day_of_week_date function.
Get the day of the week.
year | Year. |
month | Month of the year. |
day | Day of the month. |
Definition at line 2083 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for get_weekday_from_ts function.
Get the weekday from a timestamp.
ts | Timestamp. |
Definition at line 2131 of file time_conversions.hpp.
|
constexpr |
Get the day of the week.
year | Year. |
month | Month of the year. |
day | Day of the month. |
Definition at line 2064 of file time_conversions.hpp.
|
constexpr |
Alias for get_weekday_from_ts_ms function.
Get the weekday from a timestamp in milliseconds.
ts_ms | Timestamp in milliseconds. |
Definition at line 2148 of file time_conversions.hpp.
Get the day of the year.
This function returns the day of the year for the specified timestamp.
ts | Timestamp. |
Definition at line 1684 of file time_conversions.hpp.
Alias for start_of_day function.
Get the start of the day timestamp.
This function returns the timestamp at the start of the day. The function sets the hours, minutes, and seconds to zero.
ts | Timestamp. |
Definition at line 1869 of file time_conversions.hpp.
Alias for start_of_day_ms function.
Get the start of the day timestamp in milliseconds.
This function returns the timestamp at the start of the day in milliseconds. The function sets the hours, minutes, seconds, and milliseconds to zero.
ts_ms | Timestamp in milliseconds. |
Definition at line 1928 of file time_conversions.hpp.
Alias for start_of_day_sec function.
Get the start of the day timestamp in seconds.
This function returns the timestamp at the start of the day in seconds. The function sets the hours, minutes, and seconds to zero.
ts_ms | Timestamp in milliseconds. |
Definition at line 1909 of file time_conversions.hpp.
Alias for get_days_difference function.
Get the number of days between two timestamps.
This function calculates the number of days between two timestamps.
T | The type of the return value, defaults to int. |
start | The timestamp of the start of the period. |
stop | The timestamp of the end of the period. |
Definition at line 1028 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for num_days_in_month function.
Get the number of days in a month.
This function calculates and returns the number of days in the specified month and year.
year | Year as an integer. |
month | Month as an integer. |
Definition at line 1776 of file time_conversions.hpp.
Alias for num_days_in_month_ts function.
Get the number of days in the month of the given timestamp.
This function calculates and returns the number of days in the month of the specified timestamp.
ts | The timestamp to extract month and year from. |
Definition at line 1808 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for num_days_in_year function.
Get the number of days in a given year.
This function calculates and returns the number of days in the specified year.
year | Year. |
Definition at line 1829 of file time_conversions.hpp.
Alias for num_days_in_year_ts function.
Get the number of days in the current year.
This function calculates and returns the number of days in the current year based on the provided timestamp.
ts | Timestamp. |
Definition at line 1850 of file time_conversions.hpp.
Get the timestamp at the end of the day.
This function sets the hour to 23, minute to 59, and second to 59.
ts | Timestamp. |
Definition at line 2010 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX day to a timestamp representing the end of the day in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the end of the specified day (23:59:59).
T | The return type of the function (default is ts_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1169 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX day to a timestamp representing the end of the day in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the end of the specified day (23:59:59.999).
T | The return type of the function (default is ts_ms_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1182 of file time_conversions.hpp.
Get the timestamp at the end of the day in milliseconds.
This function sets the hour to 23, minute to 59, second to 59, and millisecond to 999.
ts_ms | Timestamp in milliseconds. |
Definition at line 2046 of file time_conversions.hpp.
Get the timestamp at the end of the day in seconds.
This function sets the hour to 23, minute to 59, and second to 59.
ts_ms | Timestamp in milliseconds. |
Definition at line 2028 of file time_conversions.hpp.
Get the timestamp at the end of the hour. This function sets the minute and second to 59.
ts | Timestamp (default: current timestamp). |
Definition at line 2289 of file time_conversions.hpp.
Get the timestamp at the end of the hour.
This function sets the minute and second to 59.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2325 of file time_conversions.hpp.
Get the timestamp at the end of the hour.
This function sets the minute and second to 59.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2307 of file time_conversions.hpp.
Get the timestamp of the end of the minute.
ts | Timestamp (default: current timestamp). |
Definition at line 2432 of file time_conversions.hpp.
Get the last timestamp of the current month.
This function returns the last timestamp of the current month, setting the day to the last day of the month and the time to 23:59:59.
ts | Timestamp (default is current timestamp) |
Definition at line 2180 of file time_conversions.hpp.
Get the timestamp of the end of the period.
p | Period duration in seconds. |
ts | Timestamp (default: current timestamp). |
Definition at line 2482 of file time_conversions.hpp.
Get the timestamp of the end of the week.
This function finds the timestamp of the end of the week, which corresponds to the end of Saturday.
ts | Timestamp (default: current timestamp). |
Definition at line 2383 of file time_conversions.hpp.
Get the end-of-year timestamp.
This function finds the last timestamp of the current year.
ts | Timestamp. |
Definition at line 1591 of file time_conversions.hpp.
|
inline |
Get the timestamp in milliseconds of the end of the year.
This function finds the last timestamp of the current year in milliseconds.
ts_ms | Timestamp in milliseconds. |
Definition at line 1665 of file time_conversions.hpp.
|
inline |
Alias for last_sunday_month_day function.
Get the day of the last Sunday of the given month and year.
This function returns the day of the last Sunday of the specified month and year.
year | Year |
month | Month (1 = January, 12 = December) |
Definition at line 2227 of file time_conversions.hpp.
Alias for last_sunday_of_month function.
Get the timestamp of the last Sunday of the current month.
This function returns the timestamp of the last Sunday of the current month, setting the day to the last Sunday and the time to 00:00:00.
ts | Timestamp (default is current timestamp) |
Definition at line 2205 of file time_conversions.hpp.
Alias for end_of_hour function.
Get the timestamp at the end of the hour. This function sets the minute and second to 59.
ts | Timestamp (default: current timestamp). |
Definition at line 2295 of file time_conversions.hpp.
Alias for end_of_hour_ms function.
Get the timestamp at the end of the hour.
This function sets the minute and second to 59.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2331 of file time_conversions.hpp.
Alias for end_of_hour_sec function.
Get the timestamp at the end of the hour.
This function sets the minute and second to 59.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2313 of file time_conversions.hpp.
Alias for end_of_min function.
Get the timestamp of the end of the minute.
ts | Timestamp (default: current timestamp). |
Definition at line 2438 of file time_conversions.hpp.
Alias for end_of_week function.
Get the timestamp of the end of the week.
This function finds the timestamp of the end of the week, which corresponds to the end of Saturday.
ts | Timestamp (default: current timestamp). |
Definition at line 2389 of file time_conversions.hpp.
Converts a floating-point timestamp from seconds to milliseconds.
ts | Timestamp in floating-point seconds. |
Definition at line 127 of file time_conversions.hpp.
|
inline |
Alias for tm_to_ftimestamp function.
Converts a std::tm structure to a floating-point timestamp.
This function converts a given std::tm structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
timeinfo | Pointer to the std::tm structure containing the date and time. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 952 of file time_conversions.hpp.
|
inline |
Alias for to_ftimestamp function.
Converts a date and time to a floating-point timestamp.
This function converts a given date and time to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is year_t). |
T2 | The type of the month, day, hour, minute, and second parameters (default is int). |
T3 | The type of the millisecond parameter (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 846 of file time_conversions.hpp.
|
inline |
Alias for tm_to_ftimestamp function.
Converts a std::tm structure to a floating-point timestamp.
This function converts a given std::tm structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
timeinfo | Pointer to the std::tm structure containing the date and time. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 945 of file time_conversions.hpp.
|
inline |
Alias for to_ftimestamp function.
Converts a date and time to a floating-point timestamp.
This function converts a given date and time to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is year_t). |
T2 | The type of the month, day, hour, minute, and second parameters (default is int). |
T3 | The type of the millisecond parameter (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 832 of file time_conversions.hpp.
Alias for get_days_difference function.
Get the number of days between two timestamps.
This function calculates the number of days between two timestamps.
T | The type of the return value, defaults to int. |
start | The timestamp of the start of the period. |
stop | The timestamp of the end of the period. |
Definition at line 1021 of file time_conversions.hpp.
|
constexprnoexcept |
Get the number of days between two timestamps.
This function calculates the number of days between two timestamps.
T | The type of the return value, defaults to int. |
start | The timestamp of the start of the period. |
stop | The timestamp of the end of the period. |
Definition at line 1014 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp function.
Converts a date and time to a timestamp.
This function converts a given date and time to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 488 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp function.
Converts a date and time to a timestamp.
This function converts a given date and time to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 449 of file time_conversions.hpp.
Get UNIX day.
This function returns the number of days elapsed since the UNIX epoch.
T | The return type of the function (default is unixday_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 967 of file time_conversions.hpp.
|
constexprnoexcept |
Get UNIX day from milliseconds timestamp.
This function returns the number of days elapsed since the UNIX epoch, given a timestamp in milliseconds.
T | The return type of the function (default is unixday_t). |
t_ms | Timestamp in milliseconds (default is current timestamp in milliseconds). |
Definition at line 1042 of file time_conversions.hpp.
Get UNIX minute.
This function returns the number of minutes elapsed since the UNIX epoch.
T | The return type of the function (default is int64_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1264 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX timestamp to a year.
T | The type of the year (default is year_t). |
ts | UNIX timestamp. |
Definition at line 157 of file time_conversions.hpp.
Alias for get_unix_day function.
Get UNIX day.
This function returns the number of days elapsed since the UNIX epoch.
T | The return type of the function (default is unixday_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 974 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for get_unix_day_ms function.
Get UNIX day from milliseconds timestamp.
This function returns the number of days elapsed since the UNIX epoch, given a timestamp in milliseconds.
T | The return type of the function (default is unixday_t). |
t_ms | Timestamp in milliseconds (default is current timestamp in milliseconds). |
Definition at line 1049 of file time_conversions.hpp.
|
constexpr |
Alias for day_of_week_date function.
Get the day of the week.
year | Year. |
month | Month of the year. |
day | Day of the month. |
Definition at line 2076 of file time_conversions.hpp.
|
constexprnoexcept |
Get the weekday from a timestamp.
ts | Timestamp. |
Definition at line 2124 of file time_conversions.hpp.
|
constexpr |
Get the weekday from a timestamp in milliseconds.
ts_ms | Timestamp in milliseconds. |
Definition at line 2141 of file time_conversions.hpp.
|
inline |
Get the year from the timestamp.
This function returns the year of the specified timestamp in seconds since the Unix epoch.
T | The return type of the function (default is year_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1367 of file time_conversions.hpp.
|
inline |
Get the year from the timestamp in milliseconds.
This function returns the year of the specified timestamp in milliseconds since the Unix epoch.
T | The return type of the function (default is year_t). |
ts_ms | Timestamp in milliseconds (default is current timestamp). |
Definition at line 1395 of file time_conversions.hpp.
|
inlinenoexcept |
Alias for hour24_to_12 function.
Converts a 24-hour format hour to a 12-hour format.
T | Numeric type of the hour (default is int). |
hour | The hour in 24-hour format to convert. |
Definition at line 216 of file time_conversions.hpp.
|
inlinenoexcept |
Converts a 24-hour format hour to a 12-hour format.
T | Numeric type of the hour (default is int). |
hour | The hour in 24-hour format to convert. |
Definition at line 208 of file time_conversions.hpp.
Alias for start_of_hour function.
Get the timestamp at the start of the hour.
This function sets the minute and second to zero.
ts | Timestamp (default: current timestamp). |
Definition at line 2245 of file time_conversions.hpp.
Alias for start_of_hour_ms function.
Get the timestamp at the start of the hour. This function sets the minute and second to zero.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2279 of file time_conversions.hpp.
Alias for start_of_hour_sec function.
Get the timestamp at the start of the hour.
This function sets the minute and second to zero.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2263 of file time_conversions.hpp.
Alias for hour_of_day function.
Get the hour of the day.
This function returns a value between 0 to 23 representing the hour of the day.
ts | Timestamp (default: current timestamp). |
Definition at line 2351 of file time_conversions.hpp.
Get the hour of the day.
This function returns a value between 0 to 23 representing the hour of the day.
ts | Timestamp (default: current timestamp). |
Definition at line 2344 of file time_conversions.hpp.
Alias for end_of_month function.
Get the last timestamp of the current month.
This function returns the last timestamp of the current month, setting the day to the last day of the month and the time to 23:59:59.
ts | Timestamp (default is current timestamp) |
Definition at line 2186 of file time_conversions.hpp.
|
inline |
Get the day of the last Sunday of the given month and year.
This function returns the day of the last Sunday of the specified month and year.
year | Year |
month | Month (1 = January, 12 = December) |
Definition at line 2219 of file time_conversions.hpp.
Get the timestamp of the last Sunday of the current month.
This function returns the timestamp of the last Sunday of the current month, setting the day to the last Sunday and the time to 00:00:00.
ts | Timestamp (default is current timestamp) |
Definition at line 2199 of file time_conversions.hpp.
Alias for start_of_min function.
Get the timestamp of the beginning of the minute.
ts | Timestamp (default: current timestamp). |
Definition at line 2423 of file time_conversions.hpp.
Get minute of day. This function returns a value between 0 to 1439 (minute of day).
ts | Timestamp in seconds (default: current timestamp). |
Definition at line 2449 of file time_conversions.hpp.
Get minute of hour. This function returns a value between 0 to 59.
ts | Timestamp in seconds (default: current timestamp). |
Definition at line 2460 of file time_conversions.hpp.
Alias for start_of_month function.
Get the timestamp at the start of the current month.
This function returns the timestamp at the start of the current month, setting the day to the first day of the month and the time to 00:00:00.
ts | Timestamp (default is current timestamp) |
Definition at line 2167 of file time_conversions.hpp.
|
inlinenoexcept |
Get the month of the year.
This function returns the month of the year for the specified timestamp.
ts | Timestamp. |
Definition at line 1697 of file time_conversions.hpp.
|
constexprnoexcept |
Get the millisecond part of the second from a floating-point timestamp.
T | Type of the returned value (default is int). |
ts | Timestamp in floating-point seconds. |
Definition at line 77 of file time_conversions.hpp.
|
constexprnoexcept |
Get the millisecond part of the timestamp.
T | Type of the returned value (default is int). |
ts | Timestamp in milliseconds. |
Definition at line 87 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a timestamp from milliseconds to floating-point seconds.
T | The type of the input timestamp (default is ts_ms_t). |
ts_ms | Timestamp in milliseconds. |
Definition at line 146 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a timestamp from milliseconds to seconds.
T1 | The type of the output timestamp (default is ts_t). |
T2 | The type of the input timestamp (default is ts_ms_t). |
ts_ms | Timestamp in milliseconds. |
Definition at line 137 of file time_conversions.hpp.
Calculate the timestamp for a specified number of days in the future.
Adds the given number of days to the provided timestamp, without adjusting to the start of the day.
ts | The current timestamp in seconds. |
days | The number of days to add to the current timestamp (default is 1). |
Definition at line 1986 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_from_unix_day function.
Converts a UNIX day to a timestamp representing the start of the next day in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the next day (00:00:00).
T | The return type of the function (default is ts_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1215 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_from_unix_day_ms function.
Converts a UNIX day to a timestamp representing the start of the next day in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the next day (00:00:00.000).
T | The return type of the function (default is ts_ms_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1236 of file time_conversions.hpp.
|
constexprnoexcept |
Calculate the timestamp for a specified number of days in the future (milliseconds).
Adds the given number of days to the provided timestamp, without adjusting to the start of the day.
ts_ms | The current timestamp in milliseconds. |
days | The number of days to add to the current timestamp (default is 1). |
Definition at line 1998 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day function.
Get the timestamp of the start of the day after a specified number of days.
Calculates the timestamp for the beginning of the day after a specified number of days relative to the given timestamp.
ts | The current timestamp in seconds. |
days | The number of days after the current day (default is 1). |
Definition at line 1950 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_ms function.
Get the timestamp of the start of the day after a specified number of days.
Calculates the timestamp for the beginning of the day after a specified number of days relative to the given timestamp in milliseconds.
ts_ms | The current timestamp in milliseconds. |
days | The number of days after the current day (default is 1). |
Definition at line 1972 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_from_unix_day function.
Converts a UNIX day to a timestamp representing the start of the next day in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the next day (00:00:00).
T | The return type of the function (default is ts_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1222 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_from_unix_day_ms function.
Converts a UNIX day to a timestamp representing the start of the next day in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the next day (00:00:00.000).
T | The return type of the function (default is ts_ms_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1243 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_from_unix_day function.
Converts a UNIX day to a timestamp representing the start of the next day in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the next day (00:00:00).
T | The return type of the function (default is ts_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1229 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_next_day_from_unix_day_ms function.
Converts a UNIX day to a timestamp representing the start of the next day in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the next day (00:00:00.000).
T | The return type of the function (default is ts_ms_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1250 of file time_conversions.hpp.
|
constexprnoexcept |
Get the nanosecond part of the second from a floating-point timestamp.
T | Type of the returned value (default is int). |
ts | Timestamp in floating-point seconds. |
Definition at line 57 of file time_conversions.hpp.
|
constexprnoexcept |
Get the number of days in a month.
This function calculates and returns the number of days in the specified month and year.
year | Year as an integer. |
month | Month as an integer. |
Definition at line 1763 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for num_days_in_month_ts function.
Get the number of days in the month of the given timestamp.
This function calculates and returns the number of days in the month of the specified timestamp.
ts | The timestamp to extract month and year from. |
Definition at line 1801 of file time_conversions.hpp.
|
noexcept |
Get the number of days in the month of the given timestamp.
This function calculates and returns the number of days in the month of the specified timestamp.
ts | The timestamp to extract month and year from. |
Definition at line 1789 of file time_conversions.hpp.
|
constexprnoexcept |
Get the number of days in a given year.
This function calculates and returns the number of days in the specified year.
year | Year. |
Definition at line 1821 of file time_conversions.hpp.
Get the number of days in the current year.
This function calculates and returns the number of days in the current year based on the provided timestamp.
ts | Timestamp. |
Definition at line 1842 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for start_of_prev_day function.
Get timestamp of the start of the previous day.
This function returns the timestamp at the start of the previous day.
ts | Timestamp of the current day. |
days | Number of days to go back (default is 1). |
Definition at line 1890 of file time_conversions.hpp.
Alias for start_of_saturday function.
Get the timestamp of the start of Saturday.
This function finds the timestamp of the beginning of the day on Saturday, which corresponds to the start of Saturday.
ts | Timestamp (default: current timestamp). |
Definition at line 2408 of file time_conversions.hpp.
|
constexprnoexcept |
Get the second of the day.
This function returns a value between 0 and MAX_SEC_PER_DAY representing the second of the day, given the hour, minute, and second.
T1 | The return type of the function (default is int). |
T2 | The type of the hour, minute, and second parameters (default is int). |
hour | Hour of the day. |
min | Minute of the hour. |
sec | Second of the minute. |
Definition at line 1326 of file time_conversions.hpp.
Get the second of the day.
This function returns a value from 0 to MAX_SEC_PER_DAY representing the second of the day.
T | The return type of the function (default is int). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1299 of file time_conversions.hpp.
|
constexprnoexcept |
Get the second of the day from milliseconds timestamp.
This function returns a value from 0 to MAX_SEC_PER_DAY representing the second of the day, given a timestamp in milliseconds.
T | The return type of the function (default is int). |
ts_ms | Timestamp in milliseconds. |
Definition at line 1311 of file time_conversions.hpp.
Get the second of the hour.
This function returns a value between 0 and 3599 representing the second of the hour.
T | The return type of the function (default is int). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1353 of file time_conversions.hpp.
Get the second of the minute.
This function returns a value between 0 and 59 representing the second of the minute.
T | The return type of the function (default is int). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1341 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a timestamp from seconds to milliseconds.
T1 | The type of the output timestamp (default is ts_ms_t). |
T2 | The type of the input timestamp. |
ts | Timestamp in seconds. |
Definition at line 109 of file time_conversions.hpp.
|
constexprnoexcept |
Definition at line 98 of file time_conversions.hpp.
|
constexprnoexcept |
Definition at line 93 of file time_conversions.hpp.
Get the start of the day timestamp.
This function returns the timestamp at the start of the day. The function sets the hours, minutes, and seconds to zero.
ts | Timestamp. |
Definition at line 1863 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp function.
Converts a UNIX day to a timestamp in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1113 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp_ms function.
Converts a UNIX day to a timestamp in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1154 of file time_conversions.hpp.
Get the start of the day timestamp in milliseconds.
This function returns the timestamp at the start of the day in milliseconds. The function sets the hours, minutes, seconds, and milliseconds to zero.
ts_ms | Timestamp in milliseconds. |
Definition at line 1922 of file time_conversions.hpp.
Get the start of the day timestamp in seconds.
This function returns the timestamp at the start of the day in seconds. The function sets the hours, minutes, and seconds to zero.
ts_ms | Timestamp in milliseconds. |
Definition at line 1903 of file time_conversions.hpp.
Get the timestamp at the start of the hour.
This function sets the minute and second to zero.
ts | Timestamp (default: current timestamp). |
Definition at line 2239 of file time_conversions.hpp.
Get the timestamp at the start of the hour. This function sets the minute and second to zero.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2273 of file time_conversions.hpp.
Get the timestamp at the start of the hour.
This function sets the minute and second to zero.
ts_ms | Timestamp in milliseconds (default: current timestamp in milliseconds). |
Definition at line 2257 of file time_conversions.hpp.
Get the timestamp of the beginning of the minute.
ts | Timestamp (default: current timestamp). |
Definition at line 2417 of file time_conversions.hpp.
Get the timestamp at the start of the current month.
This function returns the timestamp at the start of the current month, setting the day to the first day of the month and the time to 00:00:00.
ts | Timestamp (default is current timestamp) |
Definition at line 2161 of file time_conversions.hpp.
|
constexprnoexcept |
Get the timestamp of the start of the day after a specified number of days.
Calculates the timestamp for the beginning of the day after a specified number of days relative to the given timestamp.
ts | The current timestamp in seconds. |
days | The number of days after the current day (default is 1). |
Definition at line 1943 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX day to a timestamp representing the start of the next day in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the next day (00:00:00).
T | The return type of the function (default is ts_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1195 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX day to a timestamp representing the start of the next day in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the next day (00:00:00.000).
T | The return type of the function (default is ts_ms_t). |
unix_day | The number of days since the UNIX epoch. |
Definition at line 1208 of file time_conversions.hpp.
|
constexprnoexcept |
Get the timestamp of the start of the day after a specified number of days.
Calculates the timestamp for the beginning of the day after a specified number of days relative to the given timestamp in milliseconds.
ts_ms | The current timestamp in milliseconds. |
days | The number of days after the current day (default is 1). |
Definition at line 1965 of file time_conversions.hpp.
Get the timestamp of the start of the period.
p | Period duration in seconds. |
ts | Timestamp (default: current timestamp). |
Definition at line 2471 of file time_conversions.hpp.
|
constexprnoexcept |
Get timestamp of the start of the previous day.
This function returns the timestamp at the start of the previous day.
ts | Timestamp of the current day. |
days | Number of days to go back (default is 1). |
Definition at line 1883 of file time_conversions.hpp.
Get the timestamp of the start of Saturday.
This function finds the timestamp of the beginning of the day on Saturday, which corresponds to the start of Saturday.
ts | Timestamp (default: current timestamp). |
Definition at line 2402 of file time_conversions.hpp.
Get the timestamp of the beginning of the week.
This function finds the timestamp of the beginning of the week, which corresponds to the start of Sunday.
ts | Timestamp (default: current timestamp). |
Definition at line 2364 of file time_conversions.hpp.
Get the start of the year timestamp.
This function resets the days, months, hours, minutes, and seconds of the given timestamp to the beginning of the year.
ts | Timestamp. |
Definition at line 1422 of file time_conversions.hpp.
|
inline |
Get the timestamp of the start of the year.
This function returns the timestamp at the start of the specified year.
year | Year. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 1523 of file time_conversions.hpp.
|
inline |
Get the timestamp in milliseconds of the start of the year.
This function returns the timestamp at the start of the specified year in milliseconds.
year | Year. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 1565 of file time_conversions.hpp.
|
inlinenoexcept |
Get the start of the year timestamp in milliseconds.
This function resets the days, months, hours, minutes, and seconds of the given timestamp to the beginning of the year.
ts_ms | Timestamp in milliseconds. |
Definition at line 1497 of file time_conversions.hpp.
|
inline |
Converts a TimeZoneStruct to a single integer representation.
tz | The TimeZoneStruct to convert. |
Definition at line 94 of file time_zone_struct.hpp.
|
inline |
Alias for tm_to_timestamp function.
Converts a std::tm structure to a timestamp.
This function converts a standard C++ std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 602 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp function.
Converts a date and time to a timestamp.
This function converts a given date and time to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 475 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp_ms function.
Converts a std::tm structure to a timestamp in milliseconds.
This function converts a given std::tm structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
Definition at line 777 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp_ms function.
Converts a date and time to a timestamp in milliseconds.
This function converts a given date and time to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 675 of file time_conversions.hpp.
|
inline |
Converts a std::tm structure to a floating-point timestamp.
This function converts a given std::tm structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
timeinfo | Pointer to the std::tm structure containing the date and time. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 924 of file time_conversions.hpp.
|
inline |
Converts a std::tm structure to a timestamp.
This function converts a standard C++ std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 568 of file time_conversions.hpp.
|
inline |
Converts a std::tm structure to a timestamp in milliseconds.
This function converts a given std::tm structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
Definition at line 749 of file time_conversions.hpp.
|
inline |
Alias for tm_to_ftimestamp function.
Converts a std::tm structure to a floating-point timestamp.
This function converts a given std::tm structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
timeinfo | Pointer to the std::tm structure containing the date and time. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 931 of file time_conversions.hpp.
|
inline |
Converts a date and time to a floating-point timestamp.
This function converts a given date and time to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is year_t). |
T2 | The type of the month, day, hour, minute, and second parameters (default is int). |
T3 | The type of the millisecond parameter (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 803 of file time_conversions.hpp.
|
inline |
Alias for tm_to_ftimestamp function.
Converts a std::tm structure to a floating-point timestamp.
This function converts a given std::tm structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
timeinfo | Pointer to the std::tm structure containing the date and time. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 938 of file time_conversions.hpp.
|
inline |
Alias for to_ftimestamp function.
Converts a date and time to a floating-point timestamp.
This function converts a given date and time to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is year_t). |
T2 | The type of the month, day, hour, minute, and second parameters (default is int). |
T3 | The type of the millisecond parameter (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 818 of file time_conversions.hpp.
|
inline |
Alias for time_zone_struct_to_offset function.
Converts a TimeZoneStruct to a single integer representation.
tz | The TimeZoneStruct to convert. |
Definition at line 108 of file time_zone_struct.hpp.
|
inline |
Converts an integer to a time zone structure.
T | The type of the time zone structure (default is TimeZoneStruct). |
offset | The integer to convert. |
The function assumes that the type T has members hour
, min
, and is_positive
.
Definition at line 2494 of file time_conversions.hpp.
|
inline |
Converts an integer to a TimeZoneStruct.
offset | The integer to convert. |
Definition at line 43 of file time_zone_struct.hpp.
|
inline |
Alias for tm_to_timestamp function.
Converts a std::tm structure to a timestamp.
This function converts a standard C++ std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 581 of file time_conversions.hpp.
|
inline |
Converts a date and time to a timestamp.
This function converts a given date and time to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 378 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp_ms function.
Converts a std::tm structure to a timestamp in milliseconds.
This function converts a given std::tm structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
Definition at line 756 of file time_conversions.hpp.
|
inline |
Converts a date and time to a timestamp in milliseconds.
This function converts a given date and time to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 633 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp function.
Converts a std::tm structure to a timestamp.
This function converts a standard C++ std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 588 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp function.
Converts a date and time to a timestamp.
This function converts a given date and time to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 436 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp_ms function.
Converts a std::tm structure to a timestamp in milliseconds.
This function converts a given std::tm structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
Definition at line 763 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp_ms function.
Converts a date and time to a timestamp in milliseconds.
This function converts a given date and time to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 647 of file time_conversions.hpp.
|
inline |
Alias for to_time_zone_struct function.
Converts an integer to a TimeZoneStruct.
offset | The integer to convert. |
Definition at line 55 of file time_zone_struct.hpp.
Alias for get_unix_min function.
Get UNIX minute.
This function returns the number of minutes elapsed since the UNIX epoch.
T | The return type of the function (default is int64_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1278 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for get_unix_year function.
Converts a UNIX timestamp to a year.
T | The type of the year (default is year_t). |
ts | UNIX timestamp. |
Definition at line 197 of file time_conversions.hpp.
|
inline |
Alias for get_year function.
Get the year from the timestamp.
This function returns the year of the specified timestamp in seconds since the Unix epoch.
T | The return type of the function (default is year_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1381 of file time_conversions.hpp.
|
inline |
Alias for get_year_ms function.
Get the year from the timestamp in milliseconds.
This function returns the year of the specified timestamp in milliseconds since the Unix epoch.
T | The return type of the function (default is year_t). |
ts_ms | Timestamp in milliseconds (default is current timestamp). |
Definition at line 1409 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp function.
Converts a std::tm structure to a timestamp.
This function converts a standard C++ std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 595 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp function.
Converts a date and time to a timestamp.
This function converts a given date and time to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 462 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp function.
Converts a std::tm structure to a timestamp.
This function converts a standard C++ std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 609 of file time_conversions.hpp.
|
inline |
Alias for tm_to_timestamp_ms function.
Converts a std::tm structure to a timestamp in milliseconds.
This function converts a given std::tm structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
timeinfo | Pointer to a std::tm structure containing the date and time information. |
Definition at line 770 of file time_conversions.hpp.
|
inline |
Alias for to_timestamp_ms function.
Converts a date and time to a timestamp in milliseconds.
This function converts a given date and time to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).
T1 | The type of the year parameter (default is int64_t). |
T2 | The type of the other date and time parameters (default is int). |
year | The year value. |
month | The month value. |
day | The day value. |
hour | The hour value (default is 0). |
min | The minute value (default is 0). |
sec | The second value (default is 0). |
ms | The millisecond value (default is 0). |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 661 of file time_conversions.hpp.
|
inline |
Alias for time_zone_struct_to_offset function.
Converts a TimeZoneStruct to a single integer representation.
tz | The TimeZoneStruct to convert. |
Definition at line 101 of file time_zone_struct.hpp.
Alias for get_unix_day function.
Get UNIX day.
This function returns the number of days elapsed since the UNIX epoch.
T | The return type of the function (default is unixday_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 995 of file time_conversions.hpp.
Alias for get_unix_day_ms function.
Get UNIX day from milliseconds timestamp.
This function returns the number of days elapsed since the UNIX epoch, given a timestamp in milliseconds.
T | The return type of the function (default is unixday_t). |
t_ms | Timestamp in milliseconds (default is current timestamp in milliseconds). |
Definition at line 1070 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp function.
Converts a UNIX day to a timestamp in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1106 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp_ms function.
Converts a UNIX day to a timestamp in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1147 of file time_conversions.hpp.
Alias for get_unix_min function.
Get UNIX minute.
This function returns the number of minutes elapsed since the UNIX epoch.
T | The return type of the function (default is int64_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1285 of file time_conversions.hpp.
Alias for get_unix_day function.
Get UNIX day.
This function returns the number of days elapsed since the UNIX epoch.
T | The return type of the function (default is unixday_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 981 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for get_unix_day_ms function.
Get UNIX day from milliseconds timestamp.
This function returns the number of days elapsed since the UNIX epoch, given a timestamp in milliseconds.
T | The return type of the function (default is unixday_t). |
t_ms | Timestamp in milliseconds (default is current timestamp in milliseconds). |
Definition at line 1056 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX day to a timestamp in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1085 of file time_conversions.hpp.
|
constexprnoexcept |
Converts a UNIX day to a timestamp in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1126 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp function.
Converts a UNIX day to a timestamp in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1092 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp_ms function.
Converts a UNIX day to a timestamp in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1133 of file time_conversions.hpp.
Alias for get_unix_min function.
Get UNIX minute.
This function returns the number of minutes elapsed since the UNIX epoch.
T | The return type of the function (default is int64_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1271 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for get_unix_year function.
Converts a UNIX timestamp to a year.
T | The type of the year (default is year_t). |
ts | UNIX timestamp. |
Definition at line 190 of file time_conversions.hpp.
Alias for get_unix_day function.
Get UNIX day.
This function returns the number of days elapsed since the UNIX epoch.
T | The return type of the function (default is unixday_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 988 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for get_unix_day_ms function.
Get UNIX day from milliseconds timestamp.
This function returns the number of days elapsed since the UNIX epoch, given a timestamp in milliseconds.
T | The return type of the function (default is unixday_t). |
t_ms | Timestamp in milliseconds (default is current timestamp in milliseconds). |
Definition at line 1063 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp function.
Converts a UNIX day to a timestamp in seconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in seconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1099 of file time_conversions.hpp.
|
constexprnoexcept |
Alias for unix_day_to_timestamp_ms function.
Converts a UNIX day to a timestamp in milliseconds.
Converts a number of days since the UNIX epoch (January 1, 1970) to the corresponding timestamp in milliseconds at the start of the specified day.
T | The return type of the function (default is ts_t). |
unix_day | Number of days since the UNIX epoch. |
Definition at line 1140 of file time_conversions.hpp.
|
constexprnoexcept |
Get the microsecond part of the second from a floating-point timestamp.
T | Type of the returned value (default is int). |
ts | Timestamp in floating-point seconds. |
Definition at line 67 of file time_conversions.hpp.
Alias for start_of_week function.
Get the timestamp of the beginning of the week.
This function finds the timestamp of the beginning of the week, which corresponds to the start of Sunday.
ts | Timestamp (default: current timestamp). |
Definition at line 2370 of file time_conversions.hpp.
Alias for get_year function.
Get the year from the timestamp.
This function returns the year of the specified timestamp in seconds since the Unix epoch.
T | The return type of the function (default is year_t). |
ts | Timestamp in seconds (default is current timestamp). |
Definition at line 1374 of file time_conversions.hpp.
Alias for start_of_year function.
Get the start of the year timestamp.
This function resets the days, months, hours, minutes, and seconds of the given timestamp to the beginning of the year.
ts | Timestamp. |
Definition at line 1484 of file time_conversions.hpp.
|
inline |
Alias for start_of_year_date function.
Get the timestamp of the start of the year.
This function returns the timestamp at the start of the specified year.
year | Year. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 1551 of file time_conversions.hpp.
|
inline |
Alias for start_of_year_date_ms function.
Get the timestamp in milliseconds of the start of the year.
This function returns the timestamp at the start of the specified year in milliseconds.
year | Year. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 1579 of file time_conversions.hpp.
Alias for start_of_year_ms function.
Get the start of the year timestamp in milliseconds.
This function resets the days, months, hours, minutes, and seconds of the given timestamp to the beginning of the year.
ts_ms | Timestamp in milliseconds. |
Definition at line 1509 of file time_conversions.hpp.
Alias for end_of_year function.
Get the end-of-year timestamp.
This function finds the last timestamp of the current year.
ts | Timestamp. |
Definition at line 1652 of file time_conversions.hpp.
Alias for end_of_year_ms function.
Get the timestamp in milliseconds of the end of the year.
This function finds the last timestamp of the current year in milliseconds.
ts_ms | Timestamp in milliseconds. |
Definition at line 1671 of file time_conversions.hpp.
|
inline |
Alias for get_year_ms function.
Get the year from the timestamp in milliseconds.
This function returns the year of the specified timestamp in milliseconds since the Unix epoch.
T | The return type of the function (default is year_t). |
ts_ms | Timestamp in milliseconds (default is current timestamp). |
Definition at line 1402 of file time_conversions.hpp.
Alias for start_of_year function.
Get the start of the year timestamp.
This function resets the days, months, hours, minutes, and seconds of the given timestamp to the beginning of the year.
ts | Timestamp. |
Definition at line 1478 of file time_conversions.hpp.
|
inline |
Alias for start_of_year_date function.
Get the timestamp of the start of the year.
This function returns the timestamp at the start of the specified year.
year | Year. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 1544 of file time_conversions.hpp.
|
inline |
Alias for start_of_year_date_ms function.
Get the timestamp in milliseconds of the start of the year.
This function returns the timestamp at the start of the specified year in milliseconds.
year | Year. |
std::invalid_argument | if the date-time combination is invalid. |
Definition at line 1572 of file time_conversions.hpp.
Alias for start_of_year_ms function.
Get the start of the year timestamp in milliseconds.
This function resets the days, months, hours, minutes, and seconds of the given timestamp to the beginning of the year.
ts_ms | Timestamp in milliseconds. |
Definition at line 1503 of file time_conversions.hpp.