Time Shield Library
C++ library for working with time
|
Header file for time conversion functions. More...
#include "enums.hpp"
#include "validation.hpp"
#include "time_utils.hpp"
#include "time_zone_struct.hpp"
#include <cmath>
#include <ctime>
#include <stdexcept>
Go to the source code of this file.
Namespaces | |
namespace | time_shield |
Main namespace for the Time Shield library. | |
Macros | |
#define | _TIME_SHIELD_TIME_CONVERSIONS_HPP_INCLUDED |
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 , class T2 = ts_t> | |
T1 | time_shield::to_date_time (T2 ts) |
Converts a timestamp to a date-time structure. | |
template<class T1 , class T2 = ts_t> | |
T1 | time_shield::to_dt (T2 ts) |
Alias for to_date_time function. | |
template<class T > | |
T | time_shield::to_date_time_ms (ts_ms_t ts) |
Converts a timestamp in milliseconds to a date-time structure with milliseconds. | |
template<class T > | |
T | time_shield::to_dt_ms (ts_ms_t ts) |
Alias for to_date_time_ms 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. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::dt_to_timestamp (const T &date_time) |
Converts a date-time structure to a timestamp. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_timestamp (const T &date_time) |
Alias for dt_to_timestamp function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_ts (const T &date_time) |
Alias for dt_to_timestamp function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::ts (const T &date_time) |
Alias for dt_to_timestamp function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::timestamp (const T &date_time) |
Alias for dt_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. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::dt_to_timestamp_ms (const T &date_time) |
Converts a date-time structure to a timestamp in milliseconds. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_timestamp_ms (const T &date_time) |
Alias for dt_to_timestamp_ms function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::to_ts_ms (const T &date_time) |
Alias for dt_to_timestamp_ms function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::ts_ms (const T &date_time) |
Alias for dt_to_timestamp_ms function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const ts_t | time_shield::timestamp_ms (const T &date_time) |
Alias for dt_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. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::dt_to_ftimestamp (const T &date_time) |
Converts a date-time structure to a floating-point timestamp. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::to_ftimestamp (const T &date_time) |
Alias for dt_to_ftimestamp function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::to_fts (const T &date_time) |
Alias for dt_to_ftimestamp function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::fts (const T &date_time) |
Alias for dt_to_ftimestamp function. | |
template<class T > | |
TIME_SHIELD_CONSTEXPR const fts_t | time_shield::ftimestamp (const T &date_time) |
Alias for dt_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 T1 = Weekday, class T2 > | |
constexpr const T1 | time_shield::get_weekday_from_date (const T2 &date) |
Get the day of the week from a date structure. | |
template<class T1 = int, class T2 > | |
constexpr const T1 | time_shield::day_of_week_dt (const T2 &date) |
Alias for get_weekday_from_date function that accepts a date structure. | |
template<class T1 = int, class T2 > | |
constexpr const T1 | time_shield::day_of_week (const T2 &date) |
Alias for get_weekday_from_date function that accepts a date structure. | |
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. | |
Header file for time conversion functions.
This file contains functions for converting between different time representations and performing various time-related calculations.
Definition in file time_conversions.hpp.
#define _TIME_SHIELD_TIME_CONVERSIONS_HPP_INCLUDED |
Definition at line 8 of file time_conversions.hpp.