Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
Time Conversions

Utility functions for converting between time units. More...

Topics

 Time Zone Conversions
 Helpers for converting regional time zones to GMT.
 
 Time structure conversions
 

Files

file  astronomy_conversions.hpp
 Julian Date / MJD / JDN and simple lunar helpers.
 
file  MoonPhase.hpp
 Geocentric Moon phase calculator and result helpers.
 
file  ole_automation_conversions.hpp
 OLE Automation Date (OA date) conversions.
 

Functions

int time_shield::ns_of_sec (double ts)
 Get the nanosecond part of a floating-point timestamp.
 
int time_shield::us_of_sec (double ts)
 Get the microsecond part of a floating-point timestamp.
 
int time_shield::ms_of_sec (double ts)
 Get the millisecond part of a floating-point timestamp.
 
int time_shield::ms_of_ts (long ts_ms)
 Get the millisecond part of a millisecond timestamp.
 
long time_shield::sec_to_ms (double sec)
 Convert seconds to milliseconds.
 
long time_shield::ms_to_sec (long ms)
 Convert milliseconds to seconds (integer part).
 
double time_shield::ms_to_fsec (long ms)
 Convert milliseconds to floating-point seconds.
 
long time_shield::min_to_ms (double min)
 Convert minutes to milliseconds.
 
int time_shield::ms_to_min (long ms)
 Convert milliseconds to minutes (integer part).
 
long time_shield::min_to_sec (double min)
 Convert minutes to seconds.
 
int time_shield::sec_to_min (long sec)
 Convert seconds to minutes (integer part).
 
double time_shield::min_to_fsec (double min)
 Convert minutes to floating-point seconds.
 
double time_shield::sec_to_fmin (long sec)
 Convert seconds to floating-point minutes.
 
long time_shield::hour_to_ms (double hr)
 Convert hours to milliseconds.
 
int time_shield::ms_to_hour (long ms)
 Convert milliseconds to hours (integer part).
 
long time_shield::hour_to_sec (double hr)
 Convert hours to seconds.
 
int time_shield::sec_to_hour (long sec)
 Convert seconds to hours (integer part).
 
double time_shield::hour_to_fsec (double hr)
 Convert hours to floating-point seconds.
 
double time_shield::sec_to_fhour (long sec)
 Convert seconds to floating-point hours.
 
int time_shield::hour24_to_12 (int hour)
 Convert a 24-hour format hour to a 12-hour format.
 
int time_shield::h24_to_h12 (int hour)
 Alias for hour24_to_12.
 
long time_shield::get_unix_year (long ts)
 Convert a UNIX timestamp to a year.
 
long time_shield::unix_year (long ts)
 Alias for get_unix_year function.
 
long time_shield::to_unix_year (long ts)
 Alias for get_unix_year function.
 
long time_shield::get_year (long ts)
 Get the year from a timestamp.
 
long time_shield::year (long ts)
 Alias for get_year.
 
long time_shield::to_year (long ts)
 Alias for get_year.
 
long time_shield::get_year_ms (long ts_ms)
 Get the year from a millisecond timestamp.
 
long time_shield::year_ms (long ts_ms)
 Alias for get_year_ms.
 
long time_shield::to_year_ms (long ts_ms)
 Alias for get_year_ms.
 
DateTimeStruct time_shield::to_date_time (long ts)
 Convert a timestamp to a DateTimeStruct.
 
DateTimeStruct time_shield::to_dt (long ts)
 Alias for to_date_time.
 
MqlDateTime time_shield::to_date_time_mql (long ts)
 Convert a timestamp to the standard MqlDateTime structure.
 
MqlDateTime time_shield::to_mql_dt (long ts)
 Alias for to_date_time_mql.
 
DateTimeStruct time_shield::to_date_time_ms (long ts_ms)
 Convert a timestamp in milliseconds to DateTimeStruct.
 
DateTimeStruct time_shield::to_dt_ms (long ts_ms)
 Alias for to_date_time_ms.
 
long time_shield::dt_to_timestamp (const DateTimeStruct &dt)
 Convert a DateTimeStruct to timestamp.
 
long time_shield::dt_to_timestamp (const MqlDateTime &dt)
 Convert an MqlDateTime structure to timestamp.
 
long time_shield::to_timestamp (const DateTimeStruct &dt)
 Alias for dt_to_timestamp.
 
long time_shield::to_timestamp (const MqlDateTime &dt)
 Alias for dt_to_timestamp taking MqlDateTime.
 
long time_shield::to_timestamp (long year, int mon, int day, int hour=0, int min=0, int sec=0)
 Convert date and time values to a timestamp.
 
long time_shield::to_ts (long year, int mon, int day, int hour=0, int min=0, int sec=0)
 Alias for to_timestamp with explicit date fields.
 
long time_shield::to_timestamp_ms (long year, int mon, int day, int hour=0, int min=0, int sec=0, int ms=0)
 Convert date and time values to a timestamp in milliseconds.
 
long time_shield::to_ts_ms (long year, int mon, int day, int hour=0, int min=0, int sec=0, int ms=0)
 Alias for to_timestamp_ms.
 
long time_shield::ts_ms (long year, int mon, int day, int hour=0, int min=0, int sec=0, int ms=0)
 Alias for to_timestamp_ms.
 
long time_shield::dt_to_timestamp_ms (const DateTimeStruct &dt)
 Convert a DateTimeStruct to a timestamp in milliseconds.
 
long time_shield::dt_to_timestamp_ms (const MqlDateTime &dt)
 Convert an MqlDateTime structure to a timestamp in milliseconds.
 
long time_shield::to_timestamp_ms (const DateTimeStruct &dt)
 Alias for dt_to_timestamp_ms.
 
long time_shield::to_timestamp_ms (const MqlDateTime &dt)
 Alias for dt_to_timestamp_ms.
 
double time_shield::dt_to_ftimestamp (const DateTimeStruct &dt)
 Convert a DateTimeStruct to floating-point timestamp.
 
double time_shield::dt_to_ftimestamp (const MqlDateTime &dt)
 Convert an MqlDateTime structure to floating-point timestamp.
 
double time_shield::to_ftimestamp (const DateTimeStruct &dt)
 Alias for dt_to_ftimestamp.
 
double time_shield::to_ftimestamp (const MqlDateTime &dt)
 Alias for dt_to_ftimestamp.
 
long time_shield::start_of_day (long ts)
 Get the start of the day for a timestamp.
 
long time_shield::day_start (long ts)
 Alias for start_of_day.
 
long time_shield::start_of_prev_day (long ts, int days=1)
 Get the start of the previous day.
 
long time_shield::previous_day_start (long ts, int days=1)
 Alias for start_of_prev_day.
 
long time_shield::start_of_day_sec (long ts_ms)
 Get the start of the day in seconds from milliseconds timestamp.
 
long time_shield::day_start_sec (long ts_ms)
 Alias for start_of_day_sec.
 
long time_shield::start_of_day_ms (long ts_ms)
 Get the start of the day for a millisecond timestamp.
 
long time_shield::day_start_ms (long ts_ms)
 Alias for start_of_day_ms.
 
long time_shield::start_of_next_day (long ts, int days=1)
 Get the start of the next day.
 
long time_shield::next_day_start (long ts, int days=1)
 Alias for start_of_next_day.
 
long time_shield::start_of_next_day_ms (long ts_ms, int days=1)
 Get the start of the next day in milliseconds.
 
long time_shield::next_day_start_ms (long ts_ms, int days=1)
 Alias for start_of_next_day_ms.
 
long time_shield::next_day (long ts, int days=1)
 Add days to a timestamp without adjusting to start of day.
 
long time_shield::next_day_ms (long ts_ms, int days=1)
 Add days to a millisecond timestamp without adjusting to start of day.
 
long time_shield::end_of_day (long ts)
 Get the end of the day for a timestamp.
 
long time_shield::day_end (long ts)
 Alias for end_of_day.
 
long time_shield::end_of_day_sec (long ts_ms)
 Get the end of the day in seconds from milliseconds timestamp.
 
long time_shield::day_end_sec (long ts_ms)
 Alias for end_of_day_sec.
 
long time_shield::end_of_day_ms (long ts_ms)
 Get the end of the day for a millisecond timestamp.
 
long time_shield::day_end_ms (long ts_ms)
 Alias for end_of_day_ms.
 
Weekday time_shield::day_of_week_date (long year, int month, int day)
 Get the day of the week for a date.
 
Weekday time_shield::get_weekday (long year, int month, int day)
 Alias for day_of_week_date.
 
Weekday time_shield::day_of_week (long year, int month, int day)
 Alias for day_of_week_date.
 
Weekday time_shield::get_weekday_from_date (const DateTimeStruct &dt)
 Get weekday from a DateTimeStruct.
 
Weekday time_shield::get_weekday_from_date (const MqlDateTime &dt)
 Get weekday from a MqlDateTime structure.
 
Weekday time_shield::day_of_week_dt (const DateTimeStruct &dt)
 Alias for get_weekday_from_date with DateTimeStruct.
 
Weekday time_shield::day_of_week (const DateTimeStruct &dt)
 Alias for get_weekday_from_date with DateTimeStruct.
 
Weekday time_shield::day_of_week_dt (const MqlDateTime &dt)
 Alias for get_weekday_from_date with MqlDateTime.
 
Weekday time_shield::day_of_week (const MqlDateTime &dt)
 Alias for get_weekday_from_date with MqlDateTime.
 
Weekday time_shield::get_weekday_from_ts (long ts)
 Get weekday from timestamp.
 
Weekday time_shield::day_of_week (long ts)
 Alias for get_weekday_from_ts.
 
Weekday time_shield::get_weekday_from_ts_ms (long ts_ms)
 Get weekday from millisecond timestamp.
 
Weekday time_shield::day_of_week_ms (long ts_ms)
 Alias for get_weekday_from_ts_ms.
 
long time_shield::start_of_year (long ts)
 Get the start of the year for a timestamp.
 
long time_shield::end_of_year (long ts)
 Get the end of the year for a timestamp.
 
long time_shield::year_start (long ts)
 Alias for start_of_year.
 
long time_shield::year_begin (long ts)
 Alias for start_of_year.
 
long time_shield::start_of_year_ms (long ts_ms)
 Get the start of the year in milliseconds.
 
long time_shield::year_start_ms (long ts_ms)
 Alias for start_of_year_ms.
 
long time_shield::year_begin_ms (long ts_ms)
 Alias for start_of_year_ms.
 
long time_shield::start_of_year_date (long year)
 Get the timestamp for the start of the specified year.
 
long time_shield::year_start_date (long year)
 Alias for start_of_year_date.
 
long time_shield::year_begin_date (long year)
 Alias for start_of_year_date.
 
long time_shield::start_of_year_date_ms (long year)
 Get the timestamp in milliseconds for the start of the specified year.
 
long time_shield::year_start_date_ms (long year)
 Alias for start_of_year_date_ms.
 
long time_shield::year_begin_date_ms (long year)
 Alias for start_of_year_date_ms.
 
long time_shield::end_of_year_ms (long ts_ms)
 Get the end of the year in milliseconds.
 
long time_shield::year_end_ms (long ts_ms)
 Alias for end_of_year_ms.
 
int time_shield::day_of_year (long ts)
 Get the day of the year.
 
Month time_shield::month_of_year (long ts)
 Get the month of the year.
 
int time_shield::day_of_month (long ts)
 Get the day of the month.
 
int time_shield::num_days_in_month (long year, int month)
 Get the number of days in a month.
 
int time_shield::days_in_month (long year, int month)
 Alias for num_days_in_month.
 
int time_shield::num_days_in_month_ts (long ts)
 Get the number of days in the month of a timestamp.
 
int time_shield::num_days_in_month (long ts)
 Alias for num_days_in_month_ts.
 
int time_shield::days_in_month (long ts)
 Alias for num_days_in_month_ts.
 
int time_shield::first_workday_day (long year, int month)
 
int time_shield::last_workday_day (long year, int month)
 
int time_shield::count_workdays_in_month (long year, int month)
 
long time_shield::start_of_first_workday_month (long year, int month)
 Get start timestamp of the first workday of a month.
 
long time_shield::start_of_first_workday_month_ms (long year, int month)
 Get start timestamp in milliseconds of the first workday of a month.
 
long time_shield::start_of_first_workday_month (long ts)
 Get start timestamp of the first workday of the month containing timestamp.
 
long time_shield::start_of_first_workday_month_ms (long ts_ms)
 Get start timestamp in milliseconds of the first workday of the month containing timestamp.
 
long time_shield::end_of_first_workday_month (long year, int month)
 Get end timestamp of the first workday of a month.
 
long time_shield::end_of_first_workday_month_ms (long year, int month)
 Get end timestamp in milliseconds of the first workday of a month.
 
long time_shield::end_of_first_workday_month (long ts)
 Get end timestamp of the first workday of the month containing timestamp.
 
long time_shield::end_of_first_workday_month_ms (long ts_ms)
 Get end timestamp in milliseconds of the first workday of the month containing timestamp.
 
long time_shield::start_of_last_workday_month (long year, int month)
 Get start timestamp of the last workday of a month.
 
long time_shield::start_of_last_workday_month_ms (long year, int month)
 Get start timestamp in milliseconds of the last workday of a month.
 
long time_shield::start_of_last_workday_month (long ts)
 Get start timestamp of the last workday of the month containing timestamp.
 
long time_shield::start_of_last_workday_month_ms (long ts_ms)
 Get start timestamp in milliseconds of the last workday of the month containing timestamp.
 
long time_shield::end_of_last_workday_month (long year, int month)
 Get end timestamp of the last workday of a month.
 
long time_shield::end_of_last_workday_month_ms (long year, int month)
 Get end timestamp in milliseconds of the last workday of a month.
 
long time_shield::end_of_last_workday_month (long ts)
 Get end timestamp of the last workday of the month containing timestamp.
 
long time_shield::end_of_last_workday_month_ms (long ts_ms)
 Get end timestamp in milliseconds of the last workday of the month containing timestamp.
 
int time_shield::workday_index_in_month (long year, int month, int day)
 
bool time_shield::is_first_workday_of_month (long year, int month, int day)
 
bool time_shield::is_within_first_workdays_of_month (long year, int month, int day, int count)
 
bool time_shield::is_last_workday_of_month (long year, int month, int day)
 
bool time_shield::is_within_last_workdays_of_month (long year, int month, int day, int count)
 
bool time_shield::is_first_workday_of_month (const long ts)
 
bool time_shield::is_within_first_workdays_of_month (const long ts, int count)
 
bool time_shield::is_last_workday_of_month (const long ts)
 
bool time_shield::is_within_last_workdays_of_month (const long ts, int count)
 
bool time_shield::is_first_workday_of_month_ms (const long ts_ms)
 
bool time_shield::is_within_first_workdays_of_month_ms (const long ts_ms, int count)
 
bool time_shield::is_last_workday_of_month_ms (const long ts_ms)
 
bool time_shield::is_within_last_workdays_of_month_ms (const long ts_ms, int count)
 
int time_shield::num_days_in_year (long year)
 Get number of days in a year.
 
int time_shield::days_in_year (long year)
 Alias for num_days_in_year.
 
int time_shield::num_days_in_year_ts (long ts)
 Get number of days in the year of the timestamp.
 
int time_shield::days_in_year_ts (long ts)
 Alias for num_days_in_year_ts.
 
long time_shield::start_of_month (long ts)
 Get the timestamp at the start of the month.
 
long time_shield::month_begin (long ts)
 Alias for start_of_month.
 
long time_shield::end_of_month (long ts)
 Get the timestamp at the end of the month.
 
long time_shield::last_day_of_month (long ts)
 Alias for end_of_month.
 
long time_shield::last_sunday_of_month (long ts)
 Get the timestamp of the last Sunday of the month.
 
long time_shield::final_sunday_of_month (long ts)
 Alias for last_sunday_of_month.
 
int time_shield::last_sunday_month_day (long year, int month)
 Get the day of the last Sunday for the given month and year.
 
int time_shield::final_sunday_month_day (long year, int month)
 Alias for last_sunday_month_day.
 
long time_shield::start_of_hour (long ts)
 Get the start of the hour for a timestamp.
 
long time_shield::hour_begin (long ts)
 Alias for start_of_hour.
 
long time_shield::start_of_hour_sec (long ts_ms)
 Get the start of the hour in seconds from milliseconds timestamp.
 
long time_shield::hour_begin_sec (long ts_ms)
 Alias for start_of_hour_sec.
 
long time_shield::start_of_hour_ms (long ts_ms)
 Get the start of the hour for a millisecond timestamp.
 
long time_shield::hour_begin_ms (long ts_ms)
 Alias for start_of_hour_ms.
 
long time_shield::end_of_hour (long ts)
 Get the end of the hour for a timestamp.
 
long time_shield::finish_of_hour (long ts)
 Alias for end_of_hour.
 
long time_shield::end_of_hour_sec (long ts_ms)
 Get the end of the hour in seconds from milliseconds timestamp.
 
long time_shield::finish_of_hour_sec (long ts_ms)
 Alias for end_of_hour_sec.
 
long time_shield::end_of_hour_ms (long ts_ms)
 Get the end of the hour for a millisecond timestamp.
 
long time_shield::finish_of_hour_ms (long ts_ms)
 Alias for end_of_hour_ms.
 
int time_shield::hour_of_day (long ts)
 Get the hour of the day.
 
int time_shield::hour_in_day (long ts)
 Alias for hour_of_day.
 
long time_shield::start_of_week (long ts)
 Get the start of the week (Sunday).
 
long time_shield::week_begin (long ts)
 Alias for start_of_week.
 
long time_shield::end_of_week (long ts)
 Get the end of the week (Saturday end).
 
long time_shield::finish_of_week (long ts)
 Alias for end_of_week.
 
long time_shield::start_of_saturday (long ts)
 Get the start of Saturday for the week of the timestamp.
 
long time_shield::saturday_begin (long ts)
 Alias for start_of_saturday.
 
long time_shield::start_of_min (long ts)
 Get the start of the minute for a timestamp.
 
long time_shield::min_begin (long ts)
 Alias for start_of_min.
 
long time_shield::end_of_min (long ts)
 Get the end of the minute for a timestamp.
 
long time_shield::finish_of_min (long ts)
 Alias for end_of_min.
 
int time_shield::min_of_day (long ts)
 Get the minute of the day.
 
int time_shield::min_of_hour (long ts)
 Get the minute of the hour.
 
int time_shield::min_in_hour (long ts)
 Alias for min_of_hour.
 
long time_shield::start_of_period (int p, long ts)
 Get the start of a period.
 
long time_shield::end_of_period (int p, long ts)
 Get the end of a period.
 
long time_shield::date_to_unix_day (const long year, const int month, const int day)
 Convert calendar date to UNIX day.
 
long time_shield::get_unix_day (long ts)
 Get UNIX day from timestamp.
 
long time_shield::unix_day (long ts)
 Alias for get_unix_day.
 
long time_shield::get_unixday (long ts)
 Alias for get_unix_day.
 
long time_shield::unixday (long ts)
 Alias for get_unix_day.
 
long time_shield::uday (long ts)
 Alias for get_unix_day.
 
int time_shield::get_days_difference (long start, long stop)
 Get number of days between two timestamps.
 
int time_shield::get_days (long start, long stop)
 Alias for get_days_difference.
 
int time_shield::days (long start, long stop)
 Alias for get_days_difference.
 
long time_shield::get_unix_day_ms (long ts_ms)
 Get UNIX day from milliseconds timestamp.
 
long time_shield::unix_day_ms (long ts_ms)
 Alias for get_unix_day_ms.
 
long time_shield::get_unixday_ms (long ts_ms)
 Alias for get_unix_day_ms.
 
long time_shield::unixday_ms (long ts_ms)
 Alias for get_unix_day_ms.
 
long time_shield::uday_ms (long ts_ms)
 Alias for get_unix_day_ms.
 
long time_shield::unix_day_to_timestamp (long uday)
 Convert UNIX day to timestamp in seconds.
 
long time_shield::unix_day_to_ts (long uday)
 Alias for unix_day_to_timestamp.
 
long time_shield::unixday_to_ts (long uday)
 Alias for unix_day_to_timestamp.
 
long time_shield::uday_to_ts (long uday)
 Alias for unix_day_to_timestamp.
 
long time_shield::start_of_day_from_unix_day (long uday)
 Alias for unix_day_to_timestamp.
 
long time_shield::unix_day_to_timestamp_ms (long uday)
 Convert UNIX day to timestamp in milliseconds.
 
long time_shield::unix_day_to_ts_ms (long uday)
 Alias for unix_day_to_timestamp_ms.
 
long time_shield::unixday_to_ts_ms (long uday)
 Alias for unix_day_to_timestamp_ms.
 
long time_shield::uday_to_ts_ms (long uday)
 Alias for unix_day_to_timestamp_ms.
 
long time_shield::start_of_day_from_unix_day_ms (long uday)
 Alias for unix_day_to_timestamp_ms.
 
long time_shield::end_of_day_from_unix_day (long uday)
 Get end of day timestamp from UNIX day.
 
long time_shield::end_of_day_from_unix_day_ms (long uday)
 Get end of day timestamp in ms from UNIX day.
 
long time_shield::eod_from_unix_day (long uday)
 Alias for end_of_day_from_unix_day.
 
long time_shield::eod_from_unix_day_ms (long uday)
 Alias for end_of_day_from_unix_day_ms.
 
long time_shield::start_of_next_day_from_unix_day (long uday)
 Get start of next day timestamp from UNIX day.
 
long time_shield::start_of_next_day_from_unix_day_ms (long uday)
 Get start of next day timestamp in ms from UNIX day.
 
long time_shield::next_day_unix_day (long uday)
 Alias for start_of_next_day_from_unix_day.
 
long time_shield::next_day_unixday (long uday)
 Alias for start_of_next_day_from_unix_day.
 
long time_shield::next_day_unix_day_ms (long uday)
 Alias for start_of_next_day_from_unix_day_ms.
 
long time_shield::next_day_unixday_ms (long uday)
 Alias for start_of_next_day_from_unix_day_ms.
 
long time_shield::next_day_from_unix_day (long uday)
 Alias for start_of_next_day_from_unix_day.
 
long time_shield::get_unix_min (long ts)
 Get UNIX minute from timestamp.
 
long time_shield::unix_min (long ts)
 Alias for get_unix_min.
 
long time_shield::to_unix_min (long ts)
 Alias for get_unix_min.
 
long time_shield::umin (long ts)
 Alias for get_unix_min.
 
int time_shield::sec_of_day (long ts)
 Get second of day from timestamp.
 
int time_shield::sec_of_day_ms (long ts_ms)
 Get second of day from milliseconds timestamp.
 
int time_shield::sec_of_day (int hour, int min, int sec)
 Get second of day from hours, minutes and seconds.
 
TimeZoneStruct time_shield::to_time_zone (int offset)
 Convert an integer offset to a TimeZoneStruct.
 
TimeZoneStruct time_shield::to_tz_struct (int offset)
 Alias for to_time_zone.
 
datetime time_shield::cet_to_gmt (const datetime cet)
 Convert Central European Time to Greenwich Mean Time.
 
datetime time_shield::eet_to_gmt (const datetime eet)
 Convert Eastern European Time to Greenwich Mean Time.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year_of (ts_t ts=time_shield::ts())
 Get the year from the timestamp.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year_of_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Get the year from the timestamp in milliseconds.
 
template<class T1 = int, class T2 = year_t>
TIME_SHIELD_CONSTEXPR T1 time_shield::num_days_in_year (T2 year) noexcept
 Get the number of days in a year.
 
template<class T = int>
TIME_SHIELD_CONSTEXPR T time_shield::num_days_in_year_ts (ts_t ts=time_shield::ts())
 Get the number of days in the current year.
 
template<class T1 = Weekday, class T2 = year_t, class T3 = int, class T4 = int>
TIME_SHIELD_CONSTEXPR T1 time_shield::day_of_week_date (T2 year, T3 month, T4 day)
 Get the day of the week.
 
template<class T1 = Weekday, class T2>
TIME_SHIELD_CONSTEXPR T1 time_shield::weekday_of_date (const T2 &date)
 Get the day of the week from a date structure.
 
template<class T1 = Weekday, class T2>
TIME_SHIELD_CONSTEXPR T1 time_shield::weekday_from_date (const T2 &date)
 Alias for weekday_of_date.
 
TIME_SHIELD_CONSTEXPR int time_shield::iso_weekday_from_weekday (Weekday weekday) noexcept
 Convert Weekday enum to ISO weekday (Mon=1 .. Sun=7).
 
template<class Y = year_t, class M = Month, class D = int>
TIME_SHIELD_CONSTEXPR int time_shield::iso_weekday_of_date (Y year, M month, D day)
 Get ISO weekday for a calendar date.
 
template<class Y = year_t, class M = Month, class D = int>
IsoWeekDateStruct time_shield::to_iso_week_date (Y year, M month, D day)
 Convert calendar date to ISO week date.
 
IsoWeekDateStruct time_shield::to_iso_week_date (const DateStruct &date)
 Convert DateStruct to ISO week date.
 
template<class T = ts_t>
IsoWeekDateStruct time_shield::to_iso_week_date (T ts)
 Convert timestamp to ISO week date.
 
int time_shield::iso_weeks_in_year (year_t iso_year)
 Calculate number of ISO weeks in a year.
 
bool time_shield::is_valid_iso_week_date (year_t iso_year, int week, int weekday)
 Validate ISO week date components.
 
DateStruct time_shield::iso_week_date_to_date (const IsoWeekDateStruct &iso_date)
 Convert ISO week date to calendar date.
 
std::string time_shield::format_iso_week_date (const IsoWeekDateStruct &iso_date, bool extended=true, bool include_weekday=true)
 Format ISO week date to string.
 
bool time_shield::parse_iso_week_date (const char *input, std::size_t length, IsoWeekDateStruct &iso_date) noexcept
 Parse ISO week date string buffer.
 
bool time_shield::parse_iso_week_date (const std::string &input, IsoWeekDateStruct &iso_date) noexcept
 Parse ISO week date string.
 
bool time_shield::try_parse_iso_week_date (const char *input, std::size_t length, IsoWeekDateStruct &iso_date) noexcept
 Alias for parse_iso_week_date.
 
bool time_shield::try_parse_iso_week_date (const std::string &input, IsoWeekDateStruct &iso_date) noexcept
 Alias for parse_iso_week_date, std::string overload.
 
template<class T = year_t>
constexpr T time_shield::unix_year (ts_t ts) noexcept
 Alias for years_since_epoch function.
 
template<class T = year_t>
constexpr T time_shield::to_unix_year (ts_t ts) noexcept
 Alias for years_since_epoch function.
 
template<class T = year_t>
constexpr T time_shield::get_unix_year (ts_t ts) noexcept
 Alias for years_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::get_unixday (ts_t ts=time_shield::ts()) noexcept
 Alias for get_unix_day function.
 
template<class T = uday_t>
constexpr T time_shield::unix_day (ts_t ts=time_shield::ts()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::unixday (ts_t ts=time_shield::ts()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::uday (ts_t ts=time_shield::ts()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::get_unix_day (ts_t ts=time_shield::ts()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::get_unixday_ms (ts_ms_t t_ms=time_shield::ts_ms()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::unix_day_ms (ts_ms_t t_ms=time_shield::ts_ms()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::unixday_ms (ts_ms_t t_ms=time_shield::ts_ms()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::uday_ms (ts_ms_t t_ms=time_shield::ts_ms()) noexcept
 Alias for days_since_epoch function.
 
template<class T = uday_t>
constexpr T time_shield::get_unix_day_ms (ts_ms_t t_ms=time_shield::ts_ms()) noexcept
 Alias for days_since_epoch function.
 
template<class T = ts_t>
constexpr T time_shield::unix_day_to_timestamp (uday_t unix_day) noexcept
 Alias for unix_day_to_ts function.
 
template<class T = ts_t>
constexpr T time_shield::unixday_to_ts (uday_t unix_day) noexcept
 Alias for unix_day_to_ts function.
 
template<class T = ts_t>
constexpr T time_shield::uday_to_ts (uday_t unix_day) noexcept
 Alias for unix_day_to_ts function.
 
template<class T = ts_t>
constexpr T time_shield::start_of_day_from_unix_day (uday_t unix_day) noexcept
 Alias for unix_day_to_ts function.
 
template<class T = ts_t>
constexpr T time_shield::unix_day_to_timestamp_ms (uday_t unix_day) noexcept
 Alias for unix_day_to_ts_ms function.
 
template<class T = ts_t>
constexpr T time_shield::unixday_to_ts_ms (uday_t unix_day) noexcept
 Alias for unix_day_to_ts_ms function.
 
template<class T = ts_t>
constexpr T time_shield::uday_to_ts_ms (uday_t unix_day) noexcept
 Alias for unix_day_to_ts_ms function.
 
template<class T = ts_t>
constexpr T time_shield::start_of_day_from_unix_day_ms (uday_t unix_day) noexcept
 Alias for unix_day_to_ts_ms function.
 
template<class T = ts_t>
constexpr 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 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 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 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 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 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 T time_shield::minutes_since_epoch (ts_t ts=time_shield::ts())
 Alias for min_since_epoch function.
 
template<class T = int64_t>
constexpr T time_shield::unix_min (ts_t ts=time_shield::ts())
 Alias for min_since_epoch function.
 
template<class T = int64_t>
constexpr T time_shield::to_unix_min (ts_t ts=time_shield::ts())
 Alias for min_since_epoch function.
 
template<class T = int64_t>
constexpr T time_shield::umin (ts_t ts=time_shield::ts())
 Alias for min_since_epoch function.
 
template<class T = int64_t>
constexpr T time_shield::get_unix_min (ts_t ts=time_shield::ts())
 Alias for min_since_epoch function.
 
template<class T>
TIME_SHIELD_CONSTEXPR auto time_shield::dt_to_ts (const T &date_time) -> decltype(dt_to_timestamp(date_time))
 Alias for dt_to_timestamp.
 
TIME_SHIELD_CONSTEXPR auto time_shield::tm_to_ts (const std::tm *timeinfo) -> decltype(tm_to_timestamp(timeinfo))
 Alias for tm_to_timestamp.
 
template<class T = int>
TIME_SHIELD_CONSTEXPR 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_dt (T2 ts)
 Alias for to_date_time function.
 
template<class T1, class T2 = ts_t>
T1 time_shield::to_dt_struct (T2 ts)
 Alias for to_date_time function.
 
auto time_shield::to_dt (ts_t ts) -> decltype(to_date_time(ts))
 Alias for to_date_time function.
 
template<class T>
time_shield::to_dt_ms (ts_ms_t ts)
 Alias for to_date_time_ms function.
 
template<class T>
time_shield::to_dt_struct_ms (ts_ms_t ts)
 Alias for to_date_time_ms function.
 
auto time_shield::to_dt_ms (ts_ms_t ts_ms) -> decltype(to_date_time_ms< DateTimeStruct >(ts_ms))
 Alias for to_date_time_ms function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts (year_t year, int month, int day)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts (year_t year, int month, int day, int hour)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts (year_t year, int month, int day)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts (year_t year, int month, int day, int hour)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp (year_t year, int month, int day)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp (year_t year, int month, int day, int hour)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp (year_t year, int month, int day)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp (year_t year, int month, int day, int hour)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts (year_t year, int month, int day)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts (year_t year, int month, int day, int hour)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp (const T &date_time)
 Alias for dt_to_timestamp function.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts (const T &date_time)
 Alias for dt_to_timestamp function.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts (const T &date_time)
 Alias for dt_to_timestamp function.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp (const T &date_time)
 Alias for dt_to_timestamp function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts_from_tm (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp (const std::tm *timeinfo)
 Alias for tm_to_timestamp.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms (year_t year, int month, int day)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms (year_t year, int month, int day, int hour)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms (year_t year, int month, int day, int hour, int min, int sec, int ms)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms (year_t year, int month, int day)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms (year_t year, int month, int day, int hour)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms (year_t year, int month, int day, int hour, int min, int sec, int ms)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms (year_t year, int month, int day)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms (year_t year, int month, int day, int hour)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms (year_t year, int month, int day, int hour, int min, int sec, int ms)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms (year_t year, int month, int day)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms (year_t year, int month, int day, int hour)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms (year_t year, int month, int day, int hour, int min, int sec, int ms)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms (year_t year, int month, int day)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms (year_t year, int month, int day, int hour)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms (year_t year, int month, int day, int hour, int min)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms (year_t year, int month, int day, int hour, int min, int sec)
 Alias for to_timestamp_ms.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms (year_t year, int month, int day, int hour, int min, int sec, int ms)
 Alias for to_timestamp_ms.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp_ms (const T &date_time)
 Alias for dt_to_timestamp_ms function.
 
template<class T>
TIME_SHIELD_CONSTEXPR auto time_shield::dt_to_ts_ms (const T &date_time) -> decltype(dt_to_timestamp_ms(date_time))
 Alias for dt_to_timestamp_ms function.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts_ms (const T &date_time)
 Alias for dt_to_timestamp_ms function.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts_ms (const T &date_time)
 Alias for dt_to_timestamp_ms function.
 
template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp_ms (const T &date_time)
 Alias for dt_to_timestamp_ms function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp_ms (const std::tm *timeinfo)
 Alias for tm_to_timestamp_ms function.
 
TIME_SHIELD_CONSTEXPR auto time_shield::tm_to_ts_ms (const std::tm *timeinfo) -> decltype(tm_to_timestamp_ms(timeinfo))
 Alias for tm_to_timestamp_ms function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts_ms (const std::tm *timeinfo)
 Alias for tm_to_timestamp_ms function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts_ms (const std::tm *timeinfo)
 Alias for tm_to_timestamp_ms function.
 
TIME_SHIELD_CONSTEXPR 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>
constexpr 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.
 
template<class T1 = year_t, class T2 = int, class T3 = int>
constexpr 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.
 
template<class T1 = year_t, class T2 = int, class T3 = int>
constexpr 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.
 
template<class T>
constexpr fts_t time_shield::to_ftimestamp (const T &date_time)
 Alias for dt_to_ftimestamp.
 
template<class T>
constexpr auto time_shield::dt_to_fts (const T &date_time) -> decltype(dt_to_ftimestamp(date_time))
 Alias for dt_to_ftimestamp.
 
template<class T>
constexpr fts_t time_shield::to_fts (const T &date_time)
 Alias for dt_to_ftimestamp.
 
template<class T>
constexpr fts_t time_shield::fts (const T &date_time)
 Alias for dt_to_ftimestamp.
 
template<class T>
constexpr fts_t time_shield::ftimestamp (const T &date_time)
 Alias for dt_to_ftimestamp.
 
TIME_SHIELD_CONSTEXPR fts_t time_shield::to_ftimestamp (const std::tm *timeinfo)
 Alias for tm_to_ftimestamp.
 
TIME_SHIELD_CONSTEXPR auto time_shield::tm_to_fts (const std::tm *timeinfo) -> decltype(tm_to_ftimestamp(timeinfo))
 Alias for tm_to_ftimestamp.
 
TIME_SHIELD_CONSTEXPR fts_t time_shield::to_fts (const std::tm *timeinfo)
 Alias for tm_to_ftimestamp.
 
TIME_SHIELD_CONSTEXPR fts_t time_shield::fts (const std::tm *timeinfo)
 Alias for tm_to_ftimestamp.
 
TIME_SHIELD_CONSTEXPR fts_t time_shield::ftimestamp (const std::tm *timeinfo)
 Alias for tm_to_ftimestamp.
 
template<class T = int>
constexpr T time_shield::get_days (ts_t start, ts_t stop) noexcept
 Alias for days_between function.
 
template<class T = int>
constexpr T time_shield::days (ts_t start, ts_t stop) noexcept
 Alias for days_between function.
 
template<class T = int>
constexpr T time_shield::get_days_difference (ts_t start, ts_t stop) noexcept
 Alias for days_between function.
 
template<class T = int>
constexpr T time_shield::diff_in_days (ts_t start, ts_t stop) noexcept
 Alias for days_between function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year (ts_t ts=time_shield::ts())
 Alias for year_of function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::to_year (ts_t ts=time_shield::ts())
 Alias for year_of function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::get_year (ts_t ts=time_shield::ts())
 Alias for year_of function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Alias for year_of_ms function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::to_year_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Alias for year_of_ms function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::get_year_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Alias for year_of_ms function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::year_start (ts_t ts=time_shield::ts())
 Alias for start_of_year function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::year_begin (ts_t ts=time_shield::ts())
 Alias for start_of_year function.
 
ts_ms_t time_shield::year_start_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Alias for start_of_year_ms function.
 
ts_ms_t time_shield::year_begin_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Alias for start_of_year_ms function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR ts_t time_shield::year_start_date (T year)
 Alias for start_of_year_date function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR ts_t time_shield::year_begin_date (T year)
 Alias for start_of_year_date function.
 
template<class T = year_t>
TIME_SHIELD_CONSTEXPR 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 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::year_end (ts_t ts=time_shield::ts())
 Alias for end_of_year function.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::year_end_ms (ts_ms_t ts_ms=time_shield::ts_ms())
 Alias for end_of_year_ms function.
 
template<class T1 = int, class T2 = year_t, class T3 = int>
constexpr T1 time_shield::days_in_month (T2 year, T3 month) noexcept
 Alias for num_days_in_month function.
 
template<class T1 = int>
constexpr T1 time_shield::num_days_in_month (ts_t ts=time_shield::ts()) noexcept
 Alias for num_days_in_month_ts function.
 
template<class T1 = int>
constexpr T1 time_shield::days_in_month (ts_t ts=time_shield::ts()) noexcept
 Alias for num_days_in_month_ts function.
 
template<class T1 = int, class T2 = year_t>
constexpr T1 time_shield::days_in_year (T2 year) noexcept
 Alias for num_days_in_year function.
 
template<class T = int>
constexpr T time_shield::days_in_year_ts (ts_t ts=time_shield::ts())
 Alias for num_days_in_year_ts function.
 
constexpr ts_t time_shield::day_start (ts_t ts=time_shield::ts()) noexcept
 Alias for start_of_day function.
 
template<class T = int>
constexpr ts_t time_shield::previous_day_start (ts_t ts=time_shield::ts(), T days=1) noexcept
 Alias for start_of_prev_day function.
 
constexpr ts_t time_shield::day_start_sec (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for start_of_day_sec function.
 
constexpr ts_t time_shield::start_day_sec (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for start_of_day_sec function.
 
constexpr ts_ms_t time_shield::day_start_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for start_of_day_ms function.
 
template<class T = int>
constexpr 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 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.
 
constexpr ts_t time_shield::day_end (ts_t ts=time_shield::ts()) noexcept
 Alias for end_of_day function.
 
constexpr ts_t time_shield::day_end_sec (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for end_of_day_sec function.
 
constexpr ts_ms_t time_shield::day_end_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for end_of_day_ms function.
 
template<class T1 = Weekday>
constexpr T1 time_shield::day_of_week (year_t year, int month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::day_of_week (year_t year, Month month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::get_weekday (year_t year, int month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::get_weekday (year_t year, Month month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::weekday (year_t year, int month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::weekday (year_t year, Month month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::dow (year_t year, int month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday>
constexpr T1 time_shield::dow (year_t year, Month month, int day)
 Alias for day_of_week_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
TIME_SHIELD_CONSTEXPR T1 time_shield::get_weekday_from_date (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::get_dow (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::dow_from_date (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::weekday_of (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::day_of_week_dt (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::day_of_week (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::dow (const T2 &date)
 Alias for weekday_of_date.
 
template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
constexpr T1 time_shield::wd (const T2 &date)
 Alias for weekday_of_date.
 
template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
constexpr T time_shield::day_of_week (U ts) noexcept
 Alias for weekday_of_ts.
 
template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
constexpr T time_shield::dow_ts (U ts) noexcept
 Alias for weekday_of_ts.
 
template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
constexpr T time_shield::get_dow_from_ts (U ts) noexcept
 Alias for weekday_of_ts.
 
template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
constexpr T time_shield::get_weekday_from_ts (U ts) noexcept
 Alias for weekday_of_ts.
 
template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
constexpr T time_shield::wd_ts (U ts) noexcept
 Alias for weekday_of_ts.
 
template<class T = Weekday>
constexpr T time_shield::day_of_week_ms (ts_ms_t ts_ms)
 Alias for weekday_of_ts_ms function.
 
template<class T = Weekday>
constexpr T time_shield::wd_ms (ts_ms_t ts_ms)
 Alias for weekday_of_ts_ms function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::month_begin (ts_t ts=time_shield::ts())
 Alias for start_of_month function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::last_day_of_month (ts_t ts=time_shield::ts())
 Alias for end_of_month function.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::final_sunday_of_month (ts_t ts=time_shield::ts())
 Alias for last_sunday_of_month function.
 
template<class T1 = int, class T2 = year_t, class T3 = int>
TIME_SHIELD_CONSTEXPR T1 time_shield::final_sunday_month_day (T2 year, T3 month)
 Alias for last_sunday_month_day function.
 
constexpr ts_t time_shield::hour_begin (ts_t ts=time_shield::ts()) noexcept
 Alias for start_of_hour function.
 
constexpr ts_t time_shield::hour_begin_sec (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for start_of_hour_sec function.
 
constexpr ts_ms_t time_shield::hour_begin_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for start_of_hour_ms function.
 
constexpr ts_t time_shield::finish_of_hour (ts_t ts=time_shield::ts()) noexcept
 Alias for end_of_hour function.
 
constexpr ts_t time_shield::finish_of_hour_sec (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for end_of_hour_sec function.
 
constexpr ts_ms_t time_shield::finish_of_hour_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Alias for end_of_hour_ms function.
 
template<class T = int>
constexpr T time_shield::hour_in_day (ts_t ts=time_shield::ts()) noexcept
 Alias for hour_of_day function.
 
constexpr ts_t time_shield::week_begin (ts_t ts=time_shield::ts())
 Alias for start_of_week function.
 
constexpr ts_t time_shield::finish_of_week (ts_t ts=time_shield::ts())
 Alias for end_of_week function.
 
constexpr ts_t time_shield::saturday_begin (ts_t ts=time_shield::ts())
 Alias for start_of_saturday function.
 
constexpr ts_t time_shield::min_begin (ts_t ts=time_shield::ts()) noexcept
 Alias for start_of_min function.
 
constexpr ts_t time_shield::finish_of_min (ts_t ts=time_shield::ts()) noexcept
 Alias for end_of_min function.
 
TIME_SHIELD_CONSTEXPR bool time_shield::workday (ts_t ts) noexcept
 Alias for is_workday(ts_t).
 
TIME_SHIELD_CONSTEXPR bool time_shield::workday_ms (ts_ms_t ts_ms) noexcept
 Alias for is_workday(ts_ms_t).
 
TIME_SHIELD_CONSTEXPR bool time_shield::workday (year_t year, int month, int day) noexcept
 Alias for is_workday(year_t, int, int).
 
template<class T>
TIME_SHIELD_CONSTEXPR tz_t time_shield::tz_offset (const T &tz) noexcept
 Alias for to_tz_offset.
 
TIME_SHIELD_CONSTEXPR tz_t time_shield::offset_hm (int hour, int min=0) noexcept
 Alias for tz_offset_hm.
 
TIME_SHIELD_CONSTEXPR bool time_shield::valid_tz_offset (tz_t off) noexcept
 Alias for is_valid_tz_offset.
 
template<class T = int>
constexpr 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 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 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 T time_shield::ms_of_ts (ts_ms_t ts) noexcept
 Get the millisecond part of the timestamp.
 
template<class T>
constexpr ts_ms_t time_shield::sec_to_ms_impl (T t, std::true_type tag) noexcept
 Helper function for converting seconds to milliseconds (floating-point version).
 
template<class T>
constexpr ts_ms_t time_shield::sec_to_ms_impl (T t, std::false_type tag) noexcept
 Helper function for converting seconds to milliseconds (integral version).
 
template<class T1 = ts_ms_t, class T2>
constexpr T1 time_shield::sec_to_ms (T2 ts) noexcept
 Converts a timestamp from seconds to milliseconds.
 
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 T1 time_shield::ms_to_sec (T2 ts_ms) noexcept
 Converts a timestamp from milliseconds to seconds.
 
template<class T = ts_ms_t>
constexpr fts_t time_shield::ms_to_fsec (T ts_ms) noexcept
 Converts a timestamp from milliseconds to floating-point seconds.
 
template<class T>
constexpr ts_ms_t time_shield::min_to_ms_impl (T t, std::true_type tag) noexcept
 Helper function for converting minutes to milliseconds (floating-point version).
 
template<class T>
constexpr ts_ms_t time_shield::min_to_ms_impl (T t, std::false_type tag) noexcept
 Helper function for converting minutes to milliseconds (integral version).
 
template<class T1 = ts_ms_t, class T2>
constexpr T1 time_shield::min_to_ms (T2 ts) noexcept
 Converts a timestamp from minutes to milliseconds.
 
template<class T1 = int, class T2 = ts_ms_t>
constexpr T1 time_shield::ms_to_min (T2 ts) noexcept
 Converts a timestamp from milliseconds to minutes.
 
template<class T>
constexpr ts_t time_shield::min_to_sec_impl (T t, std::true_type tag) noexcept
 Helper function for converting minutes to seconds (floating-point version).
 
template<class T>
constexpr ts_t time_shield::min_to_sec_impl (T t, std::false_type tag) noexcept
 Helper function for converting minutes to seconds (integral version).
 
template<class T1 = ts_t, class T2>
constexpr T1 time_shield::min_to_sec (T2 ts) noexcept
 Converts a timestamp from minutes to seconds.
 
template<class T1 = int, class T2 = ts_t>
constexpr T1 time_shield::sec_to_min (T2 ts) noexcept
 Converts a timestamp from seconds to minutes.
 
template<class T = int>
constexpr fts_t time_shield::min_to_fsec (T min) noexcept
 Converts a timestamp from minutes to floating-point seconds.
 
template<class T = ts_t>
constexpr double time_shield::sec_to_fmin (T ts) noexcept
 Converts a timestamp from seconds to floating-point minutes.
 
template<class T>
constexpr ts_ms_t time_shield::hour_to_ms_impl (T t, std::true_type tag) noexcept
 Helper function for converting hours to milliseconds (floating-point version).
 
template<class T>
constexpr ts_ms_t time_shield::hour_to_ms_impl (T t, std::false_type tag) noexcept
 Helper function for converting hours to milliseconds (integral version).
 
template<class T1 = ts_ms_t, class T2>
constexpr T1 time_shield::hour_to_ms (T2 ts) noexcept
 Converts a timestamp from hours to milliseconds.
 
template<class T1 = int, class T2 = ts_ms_t>
constexpr T1 time_shield::ms_to_hour (T2 ts) noexcept
 Converts a timestamp from milliseconds to hours.
 
template<class T>
constexpr ts_t time_shield::hour_to_sec_impl (T t, std::true_type tag) noexcept
 Helper function for converting hours to seconds (floating-point version).
 
template<class T>
constexpr ts_t time_shield::hour_to_sec_impl (T t, std::false_type tag) noexcept
 Helper function for converting hours to seconds (integral version).
 
template<class T1 = ts_t, class T2>
constexpr T1 time_shield::hour_to_sec (T2 ts) noexcept
 Converts a timestamp from hours to seconds.
 
template<class T1 = int, class T2 = ts_t>
constexpr T1 time_shield::sec_to_hour (T2 ts) noexcept
 Converts a timestamp from seconds to hours.
 
template<class T = int>
constexpr fts_t time_shield::hour_to_fsec (T hr) noexcept
 Converts a timestamp from hours to floating-point seconds.
 
template<class T = ts_t>
constexpr double time_shield::sec_to_fhour (T ts) noexcept
 Converts a timestamp from seconds to floating-point hours.
 
template<class T = int>
TIME_SHIELD_CONSTEXPR T time_shield::hour24_to_12 (T hour) noexcept
 Converts a 24-hour format hour to a 12-hour format.
 
template<class T = TimeZoneStruct>
time_shield::to_time_zone (tz_t offset)
 Converts an integer to a time zone structure.
 
template<class T>
TIME_SHIELD_CONSTEXPR tz_t time_shield::to_tz_offset (const T &tz) noexcept
 Convert time zone struct to offset in seconds.
 
TIME_SHIELD_CONSTEXPR tz_t time_shield::tz_offset_hm (int hour, int min=0) noexcept
 Build offset in seconds from hours/minutes.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_valid_tz_offset (tz_t off) noexcept
 Check if a numeric offset is within supported bounds.
 
template<class T = year_t>
constexpr T time_shield::years_since_epoch (ts_t ts) noexcept
 Converts a UNIX timestamp to a year.
 
template<class Year, class Month, class Day>
TIME_SHIELD_CONSTEXPR uday_t time_shield::date_to_unix_day (Year year, Month month, Day day) noexcept
 Convert a calendar date to UNIX day count.
 
template<class T = uday_t>
constexpr T time_shield::days_since_epoch (ts_t ts=time_shield::ts()) noexcept
 Get UNIX day.
 
template<class T = uday_t>
constexpr T time_shield::days_since_epoch_ms (ts_ms_t t_ms=time_shield::ts_ms()) noexcept
 Get UNIX day from milliseconds timestamp.
 
template<class T = int>
constexpr T time_shield::days_between (ts_t start, ts_t stop) noexcept
 Get the number of days between two timestamps.
 
template<class T = ts_t>
constexpr T time_shield::unix_day_to_ts (uday_t unix_day) noexcept
 Converts a UNIX day to a timestamp in seconds.
 
template<class T = ts_t>
constexpr T time_shield::unix_day_to_ts_ms (uday_t unix_day) noexcept
 Converts a UNIX day to a timestamp in milliseconds.
 
template<class T = ts_t>
constexpr 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 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 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 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 = int64_t>
constexpr T time_shield::min_since_epoch (ts_t ts=time_shield::ts())
 Get UNIX minute.
 
template<class T = int>
constexpr T time_shield::sec_of_day (ts_t ts=time_shield::ts()) noexcept
 Get the second of the day.
 
template<class T = int>
constexpr 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 T1 time_shield::sec_of_day (T2 hour, T2 min, T2 sec) noexcept
 Get the second of the day.
 
template<class T = int>
constexpr T time_shield::sec_of_min (ts_t ts=time_shield::ts())
 Get the second of the minute.
 
template<class T = int>
constexpr T time_shield::sec_of_hour (ts_t ts=time_shield::ts())
 Get the second of the hour.
 
TIME_SHIELD_CONSTEXPR int time_shield::first_workday_day (year_t year, int month) noexcept
 Finds the first workday number within a month.
 
TIME_SHIELD_CONSTEXPR int time_shield::last_workday_day (year_t year, int month) noexcept
 Finds the last workday number within a month.
 
TIME_SHIELD_CONSTEXPR int time_shield::count_workdays_in_month (year_t year, int month) noexcept
 Counts workdays within a month.
 
TIME_SHIELD_CONSTEXPR int time_shield::workday_index_in_month (year_t year, int month, int day) noexcept
 Returns workday position in month starting from 1.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_first_workday_of_month (year_t year, int month, int day) noexcept
 Checks whether date is the first workday of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_within_first_workdays_of_month (year_t year, int month, int day, int count) noexcept
 Checks if date falls within the first N workdays of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_last_workday_of_month (year_t year, int month, int day) noexcept
 Checks whether date is the last workday of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_within_last_workdays_of_month (year_t year, int month, int day, int count) noexcept
 Checks if date falls within the last N workdays of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_first_workday_of_month (ts_t ts) noexcept
 Checks whether timestamp is the first workday of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_first_workday_of_month_ms (ts_ms_t ts_ms) noexcept
 Checks whether millisecond timestamp is the first workday of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_within_first_workdays_of_month (ts_t ts, int count) noexcept
 Checks if timestamp falls within the first N workdays of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_within_first_workdays_of_month_ms (ts_ms_t ts_ms, int count) noexcept
 Checks if millisecond timestamp falls within the first N workdays of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_last_workday_of_month (ts_t ts) noexcept
 Checks whether timestamp is the last workday of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_last_workday_of_month_ms (ts_ms_t ts_ms) noexcept
 Checks whether millisecond timestamp is the last workday of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_within_last_workdays_of_month (ts_t ts, int count) noexcept
 Checks if timestamp falls within the last N workdays of the month.
 
TIME_SHIELD_CONSTEXPR bool time_shield::is_within_last_workdays_of_month_ms (ts_ms_t ts_ms, int count) noexcept
 Checks if millisecond timestamp falls within the last N workdays of the month.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_first_workday_month (year_t year, int month) noexcept
 Returns start-of-day timestamp for the first workday of month.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_first_workday_month_ms (year_t year, int month) noexcept
 Returns start-of-day millisecond timestamp for the first workday of month.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_first_workday_month (ts_t ts=time_shield::ts()) noexcept
 Returns start-of-day timestamp for the first workday of month derived from timestamp.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_first_workday_month_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Returns start-of-day millisecond timestamp for the first workday of month derived from millisecond timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_first_workday_month (year_t year, int month) noexcept
 Returns end-of-day timestamp for the first workday of month.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_first_workday_month_ms (year_t year, int month) noexcept
 Returns end-of-day millisecond timestamp for the first workday of month.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_first_workday_month (ts_t ts=time_shield::ts()) noexcept
 Returns end-of-day timestamp for the first workday of month derived from timestamp.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_first_workday_month_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Returns end-of-day millisecond timestamp for the first workday of month derived from millisecond timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_last_workday_month (year_t year, int month) noexcept
 Returns start-of-day timestamp for the last workday of month.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_last_workday_month_ms (year_t year, int month) noexcept
 Returns start-of-day millisecond timestamp for the last workday of month.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_last_workday_month (ts_t ts=time_shield::ts()) noexcept
 Returns start-of-day timestamp for the last workday of month derived from timestamp.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_last_workday_month_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Returns start-of-day millisecond timestamp for the last workday of month derived from millisecond timestamp.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_last_workday_month (year_t year, int month) noexcept
 Returns end-of-day timestamp for the last workday of month.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_last_workday_month_ms (year_t year, int month) noexcept
 Returns end-of-day millisecond timestamp for the last workday of month.
 
TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_last_workday_month (ts_t ts=time_shield::ts()) noexcept
 Returns end-of-day timestamp for the last workday of month derived from timestamp.
 
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_last_workday_month_ms (ts_ms_t ts_ms=time_shield::ts_ms()) noexcept
 Returns end-of-day millisecond timestamp for the last workday of month derived from millisecond timestamp.
 

Detailed Description

Utility functions for converting between time units.

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.).

Key Features:

Usage Examples:

Function Documentation

◆ cet_to_gmt()

datetime time_shield::cet_to_gmt ( const datetime cet)

Convert Central European Time to Greenwich Mean Time.

Parameters
cetTimestamp in seconds in CET.
Returns
Timestamp in seconds in GMT.

Definition at line 27 of file time_zone_conversions.mqh.

◆ count_workdays_in_month() [1/2]

int time_shield::count_workdays_in_month ( long year,
int month )

Definition at line 851 of file time_conversions.mqh.

◆ count_workdays_in_month() [2/2]

TIME_SHIELD_CONSTEXPR int time_shield::count_workdays_in_month ( year_t year,
int month )
inlinenoexcept

Counts workdays within a month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 55 of file workday_conversions.hpp.

◆ date_to_unix_day() [1/2]

long time_shield::date_to_unix_day ( const long year,
const int month,
const int day )

Convert calendar date to UNIX day.

Parameters
yearYear component.
monthMonth component.
dayDay component.
Returns
Number of days since UNIX epoch.

Definition at line 1316 of file time_conversions.mqh.

◆ date_to_unix_day() [2/2]

template<class Year, class Month, class Day>
TIME_SHIELD_CONSTEXPR uday_t time_shield::date_to_unix_day ( Year year,
Month month,
Day day )
inlinenoexcept

Convert a calendar date to UNIX day count.

Calculates the number of days since the UNIX epoch (January 1, 1970) for the provided calendar date components.

Template Parameters
YearType of the year component.
MonthType of the month component.
DayType of the day component.
Parameters
yearYear component of the date.
monthMonth component of the date.
dayDay component of the date.
Returns
Number of days since the UNIX epoch.

Definition at line 68 of file unix_time_conversions.hpp.

◆ day_end() [1/2]

long time_shield::day_end ( long ts)

Alias for end_of_day.

Get the timestamp at the end of the day.

This function sets the hour to 23, minute to 59, and second to 59.

Parameters
tsTimestamp.
Returns
Timestamp at the end of the day.

Definition at line 539 of file time_conversions.mqh.

◆ day_end() [2/2]

ts_t time_shield::day_end ( ts_t ts = time_shield::ts())
constexprnoexcept

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.

Parameters
tsTimestamp.
Returns
Timestamp at the end of the day.

Definition at line 1814 of file time_conversion_aliases.hpp.

◆ day_end_ms() [1/2]

long time_shield::day_end_ms ( long ts_ms)

Alias for end_of_day_ms.

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at the end of the day in milliseconds.

Definition at line 561 of file time_conversions.mqh.

◆ day_end_ms() [2/2]

ts_ms_t time_shield::day_end_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at the end of the day in milliseconds.

Definition at line 1830 of file time_conversion_aliases.hpp.

◆ day_end_sec() [1/2]

long time_shield::day_end_sec ( long ts_ms)

Alias for end_of_day_sec.

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at the end of the day in seconds.

Definition at line 550 of file time_conversions.mqh.

◆ day_end_sec() [2/2]

ts_t time_shield::day_end_sec ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at the end of the day in seconds.

Definition at line 1822 of file time_conversion_aliases.hpp.

◆ day_of_month()

int time_shield::day_of_month ( long ts)

Get the day of the month.

Parameters
tsTimestamp in seconds.
Returns
Day of the month.

Definition at line 768 of file time_conversions.mqh.

◆ day_of_week() [1/8]

Weekday time_shield::day_of_week ( const DateTimeStruct & dt)

Alias for get_weekday_from_date with DateTimeStruct.

Get weekday from a DateTimeStruct.

Parameters
dtDate structure with fields year, mon, day.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 604 of file time_conversions.mqh.

◆ day_of_week() [2/8]

Weekday time_shield::day_of_week ( const MqlDateTime & dt)

Alias for get_weekday_from_date with MqlDateTime.

Get weekday from a MqlDateTime structure.

Parameters
dtStandard MqlDateTime structure.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 612 of file time_conversions.mqh.

◆ day_of_week() [3/8]

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::day_of_week ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1938 of file time_conversion_aliases.hpp.

◆ day_of_week() [4/8]

Weekday time_shield::day_of_week ( long ts)

Alias for get_weekday_from_ts.

Alias for weekday_of_ts.

Get the second of the week day from a timestamp.

Parameters
tsTimestamp.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 623 of file time_conversions.mqh.

◆ day_of_week() [5/8]

Weekday time_shield::day_of_week ( long year,
int month,
int day )

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 582 of file time_conversions.mqh.

◆ day_of_week() [6/8]

template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
T time_shield::day_of_week ( U ts)
constexprnoexcept

Alias for weekday_of_ts.

Get the second of the week day from a timestamp.

Parameters
tsTimestamp.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1964 of file time_conversion_aliases.hpp.

◆ day_of_week() [7/8]

template<class T1 = Weekday>
T1 time_shield::day_of_week ( year_t year,
int month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1839 of file time_conversion_aliases.hpp.

◆ day_of_week() [8/8]

template<class T1 = Weekday>
T1 time_shield::day_of_week ( year_t year,
Month month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1846 of file time_conversion_aliases.hpp.

◆ day_of_week_date() [1/2]

Weekday time_shield::day_of_week_date ( long year,
int month,
int day )

Get the day of the week for a date.

Parameters
yearYear value.
monthMonth value.
dayDay of the month.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 568 of file time_conversions.mqh.

◆ day_of_week_date() [2/2]

template<class T1 = Weekday, class T2 = year_t, class T3 = int, class T4 = int>
TIME_SHIELD_CONSTEXPR T1 time_shield::day_of_week_date ( T2 year,
T3 month,
T4 day )
inline

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 75 of file date_conversions.hpp.

◆ day_of_week_dt() [1/3]

Weekday time_shield::day_of_week_dt ( const DateTimeStruct & dt)

Alias for get_weekday_from_date with DateTimeStruct.

Get weekday from a DateTimeStruct.

Parameters
dtDate structure with fields year, mon, day.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 600 of file time_conversions.mqh.

◆ day_of_week_dt() [2/3]

Weekday time_shield::day_of_week_dt ( const MqlDateTime & dt)

Alias for get_weekday_from_date with MqlDateTime.

Get weekday from a MqlDateTime structure.

Parameters
dtStandard MqlDateTime structure.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 608 of file time_conversions.mqh.

◆ day_of_week_dt() [3/3]

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::day_of_week_dt ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1930 of file time_conversion_aliases.hpp.

◆ day_of_week_ms() [1/2]

Weekday time_shield::day_of_week_ms ( long ts_ms)

Alias for get_weekday_from_ts_ms.

Alias for weekday_of_ts_ms.

Get the weekday from a timestamp in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 634 of file time_conversions.mqh.

◆ day_of_week_ms() [2/2]

template<class T = Weekday>
T time_shield::day_of_week_ms ( ts_ms_t ts_ms)
constexpr

Alias for weekday_of_ts_ms function.

Get the weekday from a timestamp in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 2003 of file time_conversion_aliases.hpp.

◆ day_of_year()

int time_shield::day_of_year ( long ts)

Get the day of the year.

Parameters
tsTimestamp in seconds.
Returns
Day of the year (1-366).

Definition at line 735 of file time_conversions.mqh.

◆ day_start() [1/2]

long time_shield::day_start ( long ts)

Alias for start_of_day.

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.

Parameters
tsTimestamp.
Returns
Start of the day timestamp.

Definition at line 454 of file time_conversions.mqh.

◆ day_start() [2/2]

ts_t time_shield::day_start ( ts_t ts = time_shield::ts())
constexprnoexcept

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.

Parameters
tsTimestamp.
Returns
Start of the day timestamp.

Definition at line 1757 of file time_conversion_aliases.hpp.

◆ day_start_ms() [1/2]

long time_shield::day_start_ms ( long ts_ms)

Alias for start_of_day_ms.

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Start of the day timestamp in milliseconds.

Definition at line 488 of file time_conversions.mqh.

◆ day_start_ms() [2/2]

ts_ms_t time_shield::day_start_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Start of the day timestamp in milliseconds.

Definition at line 1788 of file time_conversion_aliases.hpp.

◆ day_start_sec() [1/2]

long time_shield::day_start_sec ( long ts_ms)

Alias for start_of_day_sec.

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Start of the day timestamp in seconds.

Definition at line 477 of file time_conversions.mqh.

◆ day_start_sec() [2/2]

ts_t time_shield::day_start_sec ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Start of the day timestamp in seconds.

Definition at line 1774 of file time_conversion_aliases.hpp.

◆ days() [1/2]

int time_shield::days ( long start,
long stop )

Alias for get_days_difference.

Alias for days_between function.

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 1363 of file time_conversions.mqh.

◆ days() [2/2]

template<class T = int>
T time_shield::days ( ts_t start,
ts_t stop )
constexprnoexcept

Alias for days_between function.

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 1568 of file time_conversion_aliases.hpp.

◆ days_between()

template<class T = int>
T time_shield::days_between ( ts_t start,
ts_t stop )
constexprnoexcept

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 116 of file unix_time_conversions.hpp.

◆ days_in_month() [1/4]

int time_shield::days_in_month ( long ts)

Alias for num_days_in_month_ts.

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.

Parameters
tsThe timestamp to extract month and year from.
Returns
The number of days in the month of the given timestamp.

Definition at line 827 of file time_conversions.mqh.

◆ days_in_month() [2/4]

int time_shield::days_in_month ( long year,
int month )

Alias for num_days_in_month.

Get the number of days in a month.

Parameters
yearYear value.
monthMonth value.
Returns
Number of days in the month.

Definition at line 807 of file time_conversions.mqh.

◆ days_in_month() [3/4]

template<class T1 = int, class T2 = year_t, class T3 = int>
T1 time_shield::days_in_month ( T2 year,
T3 month )
constexprnoexcept

Alias for num_days_in_month function.

Parameters
yearYear as an integer.
monthMonth as an integer.
Returns
The number of days in the given month and year.

Definition at line 1715 of file time_conversion_aliases.hpp.

◆ days_in_month() [4/4]

template<class T1 = int>
T1 time_shield::days_in_month ( ts_t ts = time_shield::ts())
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.

Parameters
tsThe timestamp to extract month and year from.
Returns
The number of days in the month of the given timestamp.

Definition at line 1731 of file time_conversion_aliases.hpp.

◆ days_in_year() [1/2]

int time_shield::days_in_year ( long year)

Alias for num_days_in_year.

Get the number of days in a year.

Parameters
yearYear.
Returns
Number of days in the given year.

Definition at line 1081 of file time_conversions.mqh.

◆ days_in_year() [2/2]

template<class T1 = int, class T2 = year_t>
T1 time_shield::days_in_year ( T2 year)
constexprnoexcept

Alias for num_days_in_year function.

Get the number of days in a year.

Parameters
yearYear.
Returns
Number of days in the given year.

Definition at line 1740 of file time_conversion_aliases.hpp.

◆ days_in_year_ts() [1/2]

int time_shield::days_in_year_ts ( long ts)

Alias for num_days_in_year_ts.

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.

Parameters
tsTimestamp.
Returns
Number of days in the current year.

Definition at line 1093 of file time_conversions.mqh.

◆ days_in_year_ts() [2/2]

template<class T = int>
T time_shield::days_in_year_ts ( ts_t ts = time_shield::ts())
constexpr

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.

Parameters
tsTimestamp.
Returns
Number of days in the current year.

Definition at line 1749 of file time_conversion_aliases.hpp.

◆ days_since_epoch()

template<class T = uday_t>
T time_shield::days_since_epoch ( ts_t ts = time_shield::ts())
constexprnoexcept

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 91 of file unix_time_conversions.hpp.

◆ days_since_epoch_ms()

template<class T = uday_t>
T time_shield::days_since_epoch_ms ( ts_ms_t t_ms = time_shield::ts_ms())
constexprnoexcept

Get UNIX day from milliseconds timestamp.

This function returns the number of days elapsed since the UNIX epoch, given a timestamp in milliseconds.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
t_msTimestamp in milliseconds (default is current timestamp in milliseconds).
Returns
Number of days since the UNIX epoch.

Definition at line 103 of file unix_time_conversions.hpp.

◆ diff_in_days()

template<class T = int>
T time_shield::diff_in_days ( ts_t start,
ts_t stop )
constexprnoexcept

Alias for days_between function.

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 1582 of file time_conversion_aliases.hpp.

◆ dow() [1/3]

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::dow ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1946 of file time_conversion_aliases.hpp.

◆ dow() [2/3]

template<class T1 = Weekday>
T1 time_shield::dow ( year_t year,
int month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1881 of file time_conversion_aliases.hpp.

◆ dow() [3/3]

template<class T1 = Weekday>
T1 time_shield::dow ( year_t year,
Month month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1888 of file time_conversion_aliases.hpp.

◆ dow_from_date()

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::dow_from_date ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1914 of file time_conversion_aliases.hpp.

◆ dow_ts()

template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
T time_shield::dow_ts ( U ts)
constexprnoexcept

Alias for weekday_of_ts.

Get the second of the week day from a timestamp.

Parameters
tsTimestamp.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1971 of file time_conversion_aliases.hpp.

◆ dt_to_ftimestamp() [1/2]

double time_shield::dt_to_ftimestamp ( const DateTimeStruct & dt)

Convert a DateTimeStruct to floating-point timestamp.

Parameters
dtStructure with date and time fields.
Returns
Floating-point timestamp.

Definition at line 422 of file time_conversions.mqh.

◆ dt_to_ftimestamp() [2/2]

double time_shield::dt_to_ftimestamp ( const MqlDateTime & dt)

Convert an MqlDateTime structure to floating-point timestamp.

Parameters
dtStandard MqlDateTime structure.
Returns
Floating-point timestamp.

Definition at line 429 of file time_conversions.mqh.

◆ dt_to_fts()

template<class T>
auto time_shield::dt_to_fts ( const T & date_time) -> decltype(dt_to_ftimestamp(date_time))
constexpr

Alias for dt_to_ftimestamp.

Converts a date-time structure to a floating-point timestamp.

This function converts a given date and time structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1489 of file time_conversion_aliases.hpp.

◆ dt_to_timestamp() [1/2]

long time_shield::dt_to_timestamp ( const DateTimeStruct & dt)

Convert a DateTimeStruct to timestamp.

Parameters
dtStructure with date and time fields.
Returns
Timestamp in seconds.

Definition at line 321 of file time_conversions.mqh.

◆ dt_to_timestamp() [2/2]

long time_shield::dt_to_timestamp ( const MqlDateTime & dt)

Convert an MqlDateTime structure to timestamp.

Parameters
dtStandard MqlDateTime structure.
Returns
Timestamp in seconds.

Definition at line 335 of file time_conversions.mqh.

◆ dt_to_timestamp_ms() [1/2]

long time_shield::dt_to_timestamp_ms ( const DateTimeStruct & dt)

Convert a DateTimeStruct to a timestamp in milliseconds.

Parameters
dtStructure with date and time fields.
Returns
Timestamp in milliseconds.

Definition at line 400 of file time_conversions.mqh.

◆ dt_to_timestamp_ms() [2/2]

long time_shield::dt_to_timestamp_ms ( const MqlDateTime & dt)

Convert an MqlDateTime structure to a timestamp in milliseconds.

Parameters
dtStandard MqlDateTime structure.
Returns
Timestamp in milliseconds.

Definition at line 407 of file time_conversions.mqh.

◆ dt_to_ts()

template<class T>
TIME_SHIELD_CONSTEXPR auto time_shield::dt_to_ts ( const T & date_time) -> decltype(dt_to_timestamp(date_time))
inline

Alias for dt_to_timestamp.

Converts a date-time structure 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).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 272 of file time_conversion_aliases.hpp.

◆ dt_to_ts_ms()

template<class T>
TIME_SHIELD_CONSTEXPR auto time_shield::dt_to_ts_ms ( const T & date_time) -> decltype(dt_to_timestamp_ms(date_time))
inline

Alias for dt_to_timestamp_ms function.

Converts a date-time structure to a timestamp in milliseconds.

This function converts a given date and time structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1332 of file time_conversion_aliases.hpp.

◆ eet_to_gmt()

datetime time_shield::eet_to_gmt ( const datetime eet)

Convert Eastern European Time to Greenwich Mean Time.

Parameters
eetTimestamp in seconds in EET.
Returns
Timestamp in seconds in GMT.

Definition at line 104 of file time_zone_conversions.mqh.

◆ end_of_day()

long time_shield::end_of_day ( long ts)

Get the end of the day for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 23:59:59 of the same day.

Definition at line 533 of file time_conversions.mqh.

◆ end_of_day_from_unix_day() [1/2]

long time_shield::end_of_day_from_unix_day ( long uday)

Get end of day timestamp from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at 23:59:59 of the specified day.

Definition at line 1437 of file time_conversions.mqh.

◆ end_of_day_from_unix_day() [2/2]

template<class T = ts_t>
T time_shield::end_of_day_from_unix_day ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in seconds representing the end of the specified UNIX day.

Definition at line 155 of file unix_time_conversions.hpp.

◆ end_of_day_from_unix_day_ms() [1/2]

long time_shield::end_of_day_from_unix_day_ms ( long uday)

Get end of day timestamp in ms from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at 23:59:59.999 of the specified day.

Definition at line 1444 of file time_conversions.mqh.

◆ end_of_day_from_unix_day_ms() [2/2]

template<class T = ts_ms_t>
T time_shield::end_of_day_from_unix_day_ms ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_ms_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the end of the specified UNIX day.

Definition at line 168 of file unix_time_conversions.hpp.

◆ end_of_day_ms()

long time_shield::end_of_day_ms ( long ts_ms)

Get the end of the day for a millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 23:59:59.999 of the same day.

Definition at line 555 of file time_conversions.mqh.

◆ end_of_day_sec()

long time_shield::end_of_day_sec ( long ts_ms)

Get the end of the day in seconds from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 23:59:59 of the same day in seconds.

Definition at line 544 of file time_conversions.mqh.

◆ end_of_first_workday_month() [1/4]

long time_shield::end_of_first_workday_month ( long ts)

Get end timestamp of the first workday of the month containing timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 23:59:59 of the first workday or ERROR_TIMESTAMP.

Definition at line 918 of file time_conversions.mqh.

◆ end_of_first_workday_month() [2/4]

long time_shield::end_of_first_workday_month ( long year,
int month )

Get end timestamp of the first workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 23:59:59 of the first workday or ERROR_TIMESTAMP.

Definition at line 899 of file time_conversions.mqh.

◆ end_of_first_workday_month() [3/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_first_workday_month ( ts_t ts = time_shield::ts())
inlinenoexcept

Returns end-of-day timestamp for the first workday of month derived from timestamp.

Parameters
tsTimestamp in seconds.

Definition at line 257 of file workday_conversions.hpp.

◆ end_of_first_workday_month() [4/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_first_workday_month ( year_t year,
int month )
inlinenoexcept

Returns end-of-day timestamp for the first workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 233 of file workday_conversions.hpp.

◆ end_of_first_workday_month_ms() [1/4]

long time_shield::end_of_first_workday_month_ms ( long ts_ms)

Get end timestamp in milliseconds of the first workday of the month containing timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 23:59:59.999 of the first workday or ERROR_TIMESTAMP.

Definition at line 925 of file time_conversions.mqh.

◆ end_of_first_workday_month_ms() [2/4]

long time_shield::end_of_first_workday_month_ms ( long year,
int month )

Get end timestamp in milliseconds of the first workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 23:59:59.999 of the first workday or ERROR_TIMESTAMP.

Definition at line 909 of file time_conversions.mqh.

◆ end_of_first_workday_month_ms() [3/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_first_workday_month_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inlinenoexcept

Returns end-of-day millisecond timestamp for the first workday of month derived from millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.

Definition at line 263 of file workday_conversions.hpp.

◆ end_of_first_workday_month_ms() [4/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_first_workday_month_ms ( year_t year,
int month )
inlinenoexcept

Returns end-of-day millisecond timestamp for the first workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 245 of file workday_conversions.hpp.

◆ end_of_hour()

long time_shield::end_of_hour ( long ts)

Get the end of the hour for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at HH:59:59 of the same hour.

Definition at line 1177 of file time_conversions.mqh.

◆ end_of_hour_ms()

long time_shield::end_of_hour_ms ( long ts_ms)

Get the end of the hour for a millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at HH:59:59.999 of the hour.

Definition at line 1199 of file time_conversions.mqh.

◆ end_of_hour_sec()

long time_shield::end_of_hour_sec ( long ts_ms)

Get the end of the hour in seconds from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at HH:59:59 of the hour in seconds.

Definition at line 1188 of file time_conversions.mqh.

◆ end_of_last_workday_month() [1/4]

long time_shield::end_of_last_workday_month ( long ts)

Get end timestamp of the last workday of the month containing timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 23:59:59 of the last workday or ERROR_TIMESTAMP.

Definition at line 986 of file time_conversions.mqh.

◆ end_of_last_workday_month() [2/4]

long time_shield::end_of_last_workday_month ( long year,
int month )

Get end timestamp of the last workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 23:59:59 of the last workday or ERROR_TIMESTAMP.

Definition at line 967 of file time_conversions.mqh.

◆ end_of_last_workday_month() [3/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_last_workday_month ( ts_t ts = time_shield::ts())
inlinenoexcept

Returns end-of-day timestamp for the last workday of month derived from timestamp.

Parameters
tsTimestamp in seconds.

Definition at line 329 of file workday_conversions.hpp.

◆ end_of_last_workday_month() [4/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::end_of_last_workday_month ( year_t year,
int month )
inlinenoexcept

Returns end-of-day timestamp for the last workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 305 of file workday_conversions.hpp.

◆ end_of_last_workday_month_ms() [1/4]

long time_shield::end_of_last_workday_month_ms ( long ts_ms)

Get end timestamp in milliseconds of the last workday of the month containing timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 23:59:59.999 of the last workday or ERROR_TIMESTAMP.

Definition at line 993 of file time_conversions.mqh.

◆ end_of_last_workday_month_ms() [2/4]

long time_shield::end_of_last_workday_month_ms ( long year,
int month )

Get end timestamp in milliseconds of the last workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 23:59:59.999 of the last workday or ERROR_TIMESTAMP.

Definition at line 977 of file time_conversions.mqh.

◆ end_of_last_workday_month_ms() [3/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_last_workday_month_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inlinenoexcept

Returns end-of-day millisecond timestamp for the last workday of month derived from millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.

Definition at line 335 of file workday_conversions.hpp.

◆ end_of_last_workday_month_ms() [4/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::end_of_last_workday_month_ms ( year_t year,
int month )
inlinenoexcept

Returns end-of-day millisecond timestamp for the last workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 317 of file workday_conversions.hpp.

◆ end_of_min()

long time_shield::end_of_min ( long ts)

Get the end of the minute for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at mm:59 of the same minute.

Definition at line 1265 of file time_conversions.mqh.

◆ end_of_month()

long time_shield::end_of_month ( long ts)

Get the timestamp at the end of the month.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 23:59:59 on the last day of the month.

Definition at line 1109 of file time_conversions.mqh.

◆ end_of_period()

long time_shield::end_of_period ( int p,
long ts )

Get the end of a period.

Parameters
pPeriod length in seconds.
tsTimestamp (default current).
Returns
Timestamp of the end of the period.

Definition at line 1303 of file time_conversions.mqh.

◆ end_of_week()

long time_shield::end_of_week ( long ts)

Get the end of the week (Saturday end).

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 23:59:59 on Saturday of the current week.

Definition at line 1232 of file time_conversions.mqh.

◆ end_of_year()

long time_shield::end_of_year ( long ts)

Get the end of the year for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp of 23:59:59 on December 31st of the year.

Definition at line 648 of file time_conversions.mqh.

◆ end_of_year_ms()

long time_shield::end_of_year_ms ( long ts_ms)

Get the end of the year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp of 23:59:59.999 on December 31st of the year.

Definition at line 724 of file time_conversions.mqh.

◆ eod_from_unix_day()

long time_shield::eod_from_unix_day ( long uday)

Alias for end_of_day_from_unix_day.

Get end of day timestamp from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at 23:59:59 of the specified day.

Definition at line 1450 of file time_conversions.mqh.

◆ eod_from_unix_day_ms()

long time_shield::eod_from_unix_day_ms ( long uday)

Alias for end_of_day_from_unix_day_ms.

Get end of day timestamp in ms from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at 23:59:59.999 of the specified day.

Definition at line 1454 of file time_conversions.mqh.

◆ final_sunday_month_day() [1/2]

int time_shield::final_sunday_month_day ( long year,
int month )

Alias for last_sunday_month_day.

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.

Parameters
yearYear
monthMonth (1 = January, 12 = December)
Returns
Day of the last Sunday of the given month and year

Definition at line 1139 of file time_conversions.mqh.

◆ final_sunday_month_day() [2/2]

template<class T1 = int, class T2 = year_t, class T3 = int>
TIME_SHIELD_CONSTEXPR T1 time_shield::final_sunday_month_day ( T2 year,
T3 month )
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.

Parameters
yearYear
monthMonth (1 = January, 12 = December)
Returns
Day of the last Sunday of the given month and year

Definition at line 2043 of file time_conversion_aliases.hpp.

◆ final_sunday_of_month() [1/2]

long time_shield::final_sunday_of_month ( long ts)

Alias for last_sunday_of_month.

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.

Parameters
tsTimestamp (default is current timestamp)
Returns
Timestamp of the last Sunday of the current month

Definition at line 1126 of file time_conversions.mqh.

◆ final_sunday_of_month() [2/2]

TIME_SHIELD_CONSTEXPR ts_t time_shield::final_sunday_of_month ( ts_t ts = time_shield::ts())
inline

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.

Parameters
tsTimestamp (default is current timestamp)
Returns
Timestamp of the last Sunday of the current month

Definition at line 2034 of file time_conversion_aliases.hpp.

◆ finish_of_hour() [1/2]

long time_shield::finish_of_hour ( long ts)

Alias for end_of_hour.

Get the timestamp at the end of the hour.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the end of the hour.

Definition at line 1183 of file time_conversions.mqh.

◆ finish_of_hour() [2/2]

ts_t time_shield::finish_of_hour ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for end_of_hour function.

Get the timestamp at the end of the hour.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the end of the hour.

Definition at line 2075 of file time_conversion_aliases.hpp.

◆ finish_of_hour_ms() [1/2]

long time_shield::finish_of_hour_ms ( long ts_ms)

Alias for end_of_hour_ms.

Get the timestamp at the end of the hour in milliseconds.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp).
Returns
Returns the timestamp of the end of the hour in milliseconds.

Definition at line 1205 of file time_conversions.mqh.

◆ finish_of_hour_ms() [2/2]

ts_ms_t time_shield::finish_of_hour_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

Alias for end_of_hour_ms function.

Get the timestamp at the end of the hour in milliseconds.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp).
Returns
Returns the timestamp of the end of the hour in milliseconds.

Definition at line 2091 of file time_conversion_aliases.hpp.

◆ finish_of_hour_sec() [1/2]

long time_shield::finish_of_hour_sec ( long ts_ms)

Alias for end_of_hour_sec.

Get the timestamp at the end of the hour in seconds.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp).
Returns
Returns the timestamp of the end of the hour in seconds.

Definition at line 1194 of file time_conversions.mqh.

◆ finish_of_hour_sec() [2/2]

ts_t time_shield::finish_of_hour_sec ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

Alias for end_of_hour_sec function.

Get the timestamp at the end of the hour in seconds.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp).
Returns
Returns the timestamp of the end of the hour in seconds.

Definition at line 2083 of file time_conversion_aliases.hpp.

◆ finish_of_min() [1/2]

long time_shield::finish_of_min ( long ts)

Alias for end_of_min.

Get the timestamp of the end of the minute.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the end of the minute.

Definition at line 1271 of file time_conversions.mqh.

◆ finish_of_min() [2/2]

ts_t time_shield::finish_of_min ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for end_of_min function.

Get the timestamp of the end of the minute.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the end of the minute.

Definition at line 2140 of file time_conversion_aliases.hpp.

◆ finish_of_week() [1/2]

long time_shield::finish_of_week ( long ts)

Alias for end_of_week.

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.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the end of the week.

Definition at line 1238 of file time_conversions.mqh.

◆ finish_of_week() [2/2]

ts_t time_shield::finish_of_week ( ts_t ts = time_shield::ts())
constexpr

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.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the end of the week.

Definition at line 2116 of file time_conversion_aliases.hpp.

◆ first_workday_day() [1/2]

int time_shield::first_workday_day ( long year,
int month )

Definition at line 833 of file time_conversions.mqh.

◆ first_workday_day() [2/2]

TIME_SHIELD_CONSTEXPR int time_shield::first_workday_day ( year_t year,
int month )
inlinenoexcept

Finds the first workday number within a month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 23 of file workday_conversions.hpp.

◆ format_iso_week_date()

std::string time_shield::format_iso_week_date ( const IsoWeekDateStruct & iso_date,
bool extended = true,
bool include_weekday = true )
inline

Format ISO week date to string.

Parameters
iso_dateISO week date to format.
extendedWhen true, uses extended format with separators ("YYYY-Www-D").
include_weekdayWhen false, omits weekday ("YYYY-Www"). Weekday defaults to Monday when omitted.
Returns
Formatted ISO week-date string.

Definition at line 134 of file iso_week_conversions.hpp.

◆ fsec_to_ms()

ts_ms_t time_shield::fsec_to_ms ( fts_t ts)
inlinenoexcept

Converts a floating-point timestamp from seconds to milliseconds.

Parameters
tsTimestamp in floating-point seconds.
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 107 of file time_unit_conversions.hpp.

◆ ftimestamp() [1/3]

TIME_SHIELD_CONSTEXPR fts_t time_shield::ftimestamp ( const std::tm * timeinfo)
inline

Alias for tm_to_ftimestamp.

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).

Parameters
timeinfoPointer to the std::tm structure containing the date and time.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1552 of file time_conversion_aliases.hpp.

◆ ftimestamp() [2/3]

template<class T>
fts_t time_shield::ftimestamp ( const T & date_time)
constexpr

Alias for dt_to_ftimestamp.

Converts a date-time structure to a floating-point timestamp.

This function converts a given date and time structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1514 of file time_conversion_aliases.hpp.

◆ ftimestamp() [3/3]

template<class T1 = year_t, class T2 = int, class T3 = int>
fts_t time_shield::ftimestamp ( T1 year,
T2 month,
T2 day,
T2 hour = 0,
T2 min = 0,
T2 sec = 0,
T3 ms = 0 )
constexpr

Alias for to_ftimestamp.

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).

Template Parameters
T1The type of the year parameter (default is year_t).
T2The type of the month, day, hour, minute, and second parameters (default is int).
T3The type of the millisecond parameter (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value (default is 0).
minThe minute value (default is 0).
secThe second value (default is 0).
msThe millisecond value (default is 0).
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_ftimestamp

Definition at line 1471 of file time_conversion_aliases.hpp.

◆ fts() [1/3]

TIME_SHIELD_CONSTEXPR fts_t time_shield::fts ( const std::tm * timeinfo)
inline

Alias for tm_to_ftimestamp.

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).

Parameters
timeinfoPointer to the std::tm structure containing the date and time.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1545 of file time_conversion_aliases.hpp.

◆ fts() [2/3]

template<class T>
fts_t time_shield::fts ( const T & date_time)
constexpr

Alias for dt_to_ftimestamp.

Converts a date-time structure to a floating-point timestamp.

This function converts a given date and time structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1506 of file time_conversion_aliases.hpp.

◆ fts() [3/3]

template<class T1 = year_t, class T2 = int, class T3 = int>
fts_t time_shield::fts ( T1 year,
T2 month,
T2 day,
T2 hour = 0,
T2 min = 0,
T2 sec = 0,
T3 ms = 0 )
constexpr

Alias for to_ftimestamp.

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).

Template Parameters
T1The type of the year parameter (default is year_t).
T2The type of the month, day, hour, minute, and second parameters (default is int).
T3The type of the millisecond parameter (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value (default is 0).
minThe minute value (default is 0).
secThe second value (default is 0).
msThe millisecond value (default is 0).
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_ftimestamp

Definition at line 1447 of file time_conversion_aliases.hpp.

◆ get_days() [1/2]

int time_shield::get_days ( long start,
long stop )

Alias for get_days_difference.

Alias for days_between function.

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 1359 of file time_conversions.mqh.

◆ get_days() [2/2]

template<class T = int>
T time_shield::get_days ( ts_t start,
ts_t stop )
constexprnoexcept

Alias for days_between function.

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 1561 of file time_conversion_aliases.hpp.

◆ get_days_difference() [1/2]

int time_shield::get_days_difference ( long start,
long stop )

Get number of days between two timestamps.

Parameters
startStart timestamp in seconds.
stopEnd timestamp in seconds.
Returns
Difference in days.

Definition at line 1353 of file time_conversions.mqh.

◆ get_days_difference() [2/2]

template<class T = int>
T time_shield::get_days_difference ( ts_t start,
ts_t stop )
constexprnoexcept

Alias for days_between function.

Get the number of days between two timestamps.

This function calculates the number of days between two timestamps.

Template Parameters
TThe type of the return value, defaults to int.
Parameters
startThe timestamp of the start of the period.
stopThe timestamp of the end of the period.
Returns
The number of days between start and stop.

Definition at line 1575 of file time_conversion_aliases.hpp.

◆ get_dow()

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::get_dow ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1906 of file time_conversion_aliases.hpp.

◆ get_dow_from_ts()

template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
T time_shield::get_dow_from_ts ( U ts)
constexprnoexcept

Alias for weekday_of_ts.

Get the second of the week day from a timestamp.

Parameters
tsTimestamp.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1978 of file time_conversion_aliases.hpp.

◆ get_timestamp() [1/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 818 of file time_conversion_aliases.hpp.

◆ get_timestamp() [2/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp ( year_t year,
int month,
int day )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 527 of file time_conversion_aliases.hpp.

◆ get_timestamp() [3/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 547 of file time_conversion_aliases.hpp.

◆ get_timestamp() [4/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 568 of file time_conversion_aliases.hpp.

◆ get_timestamp() [5/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_timestamp ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 590 of file time_conversion_aliases.hpp.

◆ get_timestamp_ms() [1/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms ( year_t year,
int month,
int day )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1045 of file time_conversion_aliases.hpp.

◆ get_timestamp_ms() [2/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1063 of file time_conversion_aliases.hpp.

◆ get_timestamp_ms() [3/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1082 of file time_conversion_aliases.hpp.

◆ get_timestamp_ms() [4/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1102 of file time_conversion_aliases.hpp.

◆ get_timestamp_ms() [5/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_timestamp_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec,
int ms )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
msThe millisecond value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1123 of file time_conversion_aliases.hpp.

◆ get_ts() [1/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 806 of file time_conversion_aliases.hpp.

◆ get_ts() [2/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts ( year_t year,
int month,
int day )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 445 of file time_conversion_aliases.hpp.

◆ get_ts() [3/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 465 of file time_conversion_aliases.hpp.

◆ get_ts() [4/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 486 of file time_conversion_aliases.hpp.

◆ get_ts() [5/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::get_ts ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 508 of file time_conversion_aliases.hpp.

◆ get_ts_ms() [1/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms ( year_t year,
int month,
int day )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 950 of file time_conversion_aliases.hpp.

◆ get_ts_ms() [2/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 968 of file time_conversion_aliases.hpp.

◆ get_ts_ms() [3/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 987 of file time_conversion_aliases.hpp.

◆ get_ts_ms() [4/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1007 of file time_conversion_aliases.hpp.

◆ get_ts_ms() [5/5]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::get_ts_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec,
int ms )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
msThe millisecond value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1028 of file time_conversion_aliases.hpp.

◆ get_unix_day() [1/2]

long time_shield::get_unix_day ( long ts)

Get UNIX day from timestamp.

Parameters
tsTimestamp in seconds.
Returns
Number of days since UNIX epoch.

Definition at line 1329 of file time_conversions.mqh.

◆ get_unix_day() [2/2]

template<class T = uday_t>
T time_shield::get_unix_day ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 78 of file time_conversion_aliases.hpp.

◆ get_unix_day_ms() [1/2]

long time_shield::get_unix_day_ms ( long ts_ms)

Get UNIX day from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Number of days since UNIX epoch.

Definition at line 1368 of file time_conversions.mqh.

◆ get_unix_day_ms() [2/2]

template<class T = uday_t>
T time_shield::get_unix_day_ms ( ts_ms_t t_ms = time_shield::ts_ms())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 119 of file time_conversion_aliases.hpp.

◆ get_unix_min() [1/2]

long time_shield::get_unix_min ( long ts)

Get UNIX minute from timestamp.

Parameters
tsTimestamp in seconds.
Returns
Minutes since UNIX epoch.

Definition at line 1493 of file time_conversions.mqh.

◆ get_unix_min() [2/2]

template<class T = int64_t>
T time_shield::get_unix_min ( ts_t ts = time_shield::ts())
constexpr

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 262 of file time_conversion_aliases.hpp.

◆ get_unix_year() [1/2]

long time_shield::get_unix_year ( long ts)

Convert a UNIX timestamp to a year.

Parameters
tsUNIX timestamp in seconds.
Returns
Year corresponding to the given timestamp.

Definition at line 202 of file time_conversions.mqh.

◆ get_unix_year() [2/2]

template<class T = year_t>
T time_shield::get_unix_year ( ts_t ts)
constexprnoexcept

Alias for years_since_epoch function.

Converts a UNIX timestamp to a year.

Template Parameters
TThe type of the year (default is year_t).
Parameters
tsUNIX timestamp.
Returns
T Year corresponding to the given timestamp.

Definition at line 37 of file time_conversion_aliases.hpp.

◆ get_unixday() [1/2]

long time_shield::get_unixday ( long ts)

Alias for get_unix_day.

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 1339 of file time_conversions.mqh.

◆ get_unixday() [2/2]

template<class T = uday_t>
T time_shield::get_unixday ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for get_unix_day function.

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 47 of file time_conversion_aliases.hpp.

◆ get_unixday_ms() [1/2]

long time_shield::get_unixday_ms ( long ts_ms)

Alias for get_unix_day_ms.

Get UNIX day from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Number of days since UNIX epoch.

Definition at line 1378 of file time_conversions.mqh.

◆ get_unixday_ms() [2/2]

template<class T = uday_t>
T time_shield::get_unixday_ms ( ts_ms_t t_ms = time_shield::ts_ms())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 88 of file time_conversion_aliases.hpp.

◆ get_weekday() [1/3]

Weekday time_shield::get_weekday ( long year,
int month,
int day )

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 578 of file time_conversions.mqh.

◆ get_weekday() [2/3]

template<class T1 = Weekday>
T1 time_shield::get_weekday ( year_t year,
int month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1853 of file time_conversion_aliases.hpp.

◆ get_weekday() [3/3]

template<class T1 = Weekday>
T1 time_shield::get_weekday ( year_t year,
Month month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1860 of file time_conversion_aliases.hpp.

◆ get_weekday_from_date() [1/3]

Weekday time_shield::get_weekday_from_date ( const DateTimeStruct & dt)

Get weekday from a DateTimeStruct.

Parameters
dtDate structure with fields year, mon, day.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 587 of file time_conversions.mqh.

◆ get_weekday_from_date() [2/3]

Weekday time_shield::get_weekday_from_date ( const MqlDateTime & dt)

Get weekday from a MqlDateTime structure.

Parameters
dtStandard MqlDateTime structure.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 594 of file time_conversions.mqh.

◆ get_weekday_from_date() [3/3]

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
TIME_SHIELD_CONSTEXPR T1 time_shield::get_weekday_from_date ( const T2 & date)
inline

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1898 of file time_conversion_aliases.hpp.

◆ get_weekday_from_ts() [1/2]

Weekday time_shield::get_weekday_from_ts ( long ts)

Get weekday from timestamp.

Parameters
tsTimestamp in seconds.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 617 of file time_conversions.mqh.

◆ get_weekday_from_ts() [2/2]

template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
T time_shield::get_weekday_from_ts ( U ts)
constexprnoexcept

Alias for weekday_of_ts.

Get the second of the week day from a timestamp.

Parameters
tsTimestamp.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1985 of file time_conversion_aliases.hpp.

◆ get_weekday_from_ts_ms()

Weekday time_shield::get_weekday_from_ts_ms ( long ts_ms)

Get weekday from millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Weekday (SUN=0, MON=1, ... SAT=6).

Definition at line 628 of file time_conversions.mqh.

◆ get_year() [1/2]

long time_shield::get_year ( long ts)

Get the year from a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Year of the given timestamp.

Definition at line 240 of file time_conversions.mqh.

◆ get_year() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::get_year ( ts_t ts = time_shield::ts())
inline

Alias for year_of function.

Get the year from the timestamp.

This function returns the year of the specified timestamp in seconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 1605 of file time_conversion_aliases.hpp.

◆ get_year_ms() [1/2]

long time_shield::get_year_ms ( long ts_ms)

Get the year from a millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Year of the given timestamp.

Definition at line 255 of file time_conversions.mqh.

◆ get_year_ms() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::get_year_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

Alias for year_of_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.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
ts_msTimestamp in milliseconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 1628 of file time_conversion_aliases.hpp.

◆ h24_to_h12() [1/2]

int time_shield::h24_to_h12 ( int hour)

Alias for hour24_to_12.

Converts a 24-hour format hour to a 12-hour format.

Template Parameters
TNumeric type of the hour (default is int).
Parameters
hourThe hour in 24-hour format to convert.
Returns
The hour in 12-hour format.

Definition at line 193 of file time_conversions.mqh.

◆ h24_to_h12() [2/2]

template<class T = int>
TIME_SHIELD_CONSTEXPR T time_shield::h24_to_h12 ( T hour)
inlinenoexcept

Alias for hour24_to_12 function.

Converts a 24-hour format hour to a 12-hour format.

Template Parameters
TNumeric type of the hour (default is int).
Parameters
hourThe hour in 24-hour format to convert.
Returns
The hour in 12-hour format.

Definition at line 290 of file time_conversion_aliases.hpp.

◆ hour24_to_12() [1/2]

int time_shield::hour24_to_12 ( int hour)

Convert a 24-hour format hour to a 12-hour format.

Parameters
hourHour value in 24-hour format.
Returns
Hour value in 12-hour format.

Definition at line 186 of file time_conversions.mqh.

◆ hour24_to_12() [2/2]

template<class T = int>
TIME_SHIELD_CONSTEXPR T time_shield::hour24_to_12 ( T hour)
inlinenoexcept

Converts a 24-hour format hour to a 12-hour format.

Template Parameters
TNumeric type of the hour (default is int).
Parameters
hourThe hour in 24-hour format to convert.
Returns
The hour in 12-hour format.

Definition at line 401 of file time_unit_conversions.hpp.

◆ hour_begin() [1/2]

long time_shield::hour_begin ( long ts)

Alias for start_of_hour.

Get the timestamp at the start of the hour.

This function sets the minute and second to zero.

Parameters
tsTimestamp (default: current timestamp).
Returns
Timestamp at the start of the hour.

Definition at line 1150 of file time_conversions.mqh.

◆ hour_begin() [2/2]

ts_t time_shield::hour_begin ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for start_of_hour function.

Get the timestamp at the start of the hour.

This function sets the minute and second to zero.

Parameters
tsTimestamp (default: current timestamp).
Returns
Timestamp at the start of the hour.

Definition at line 2051 of file time_conversion_aliases.hpp.

◆ hour_begin_ms() [1/2]

long time_shield::hour_begin_ms ( long ts_ms)

Alias for start_of_hour_ms.

Get the timestamp at the start of the hour. This function sets the minute and second to zero.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp in milliseconds).
Returns
Timestamp at the start of the hour in milliseconds.

Definition at line 1172 of file time_conversions.mqh.

◆ hour_begin_ms() [2/2]

ts_ms_t time_shield::hour_begin_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp in milliseconds).
Returns
Timestamp at the start of the hour in milliseconds.

Definition at line 2067 of file time_conversion_aliases.hpp.

◆ hour_begin_sec() [1/2]

long time_shield::hour_begin_sec ( long ts_ms)

Alias for start_of_hour_sec.

Get the timestamp at the start of the hour.

This function sets the minute and second to zero.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp in milliseconds).
Returns
Timestamp at the start of the hour in seconds.

Definition at line 1161 of file time_conversions.mqh.

◆ hour_begin_sec() [2/2]

ts_t time_shield::hour_begin_sec ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds (default: current timestamp in milliseconds).
Returns
Timestamp at the start of the hour in seconds.

Definition at line 2059 of file time_conversion_aliases.hpp.

◆ hour_in_day() [1/2]

int time_shield::hour_in_day ( long ts)

Alias for hour_of_day.

Get hour of day. This function returns a value between 0 to 23.

Parameters
tsTimestamp in seconds (default: current timestamp).
Returns
Hour of day.

Definition at line 1216 of file time_conversions.mqh.

◆ hour_in_day() [2/2]

template<class T = int>
T time_shield::hour_in_day ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for hour_of_day function.

Get hour of day. This function returns a value between 0 to 23.

Parameters
tsTimestamp in seconds (default: current timestamp).
Returns
Hour of day.

Definition at line 2100 of file time_conversion_aliases.hpp.

◆ hour_of_day()

int time_shield::hour_of_day ( long ts)

Get the hour of the day.

Parameters
tsTimestamp in seconds.
Returns
Hour value 0-23.

Definition at line 1210 of file time_conversions.mqh.

◆ hour_to_fsec() [1/2]

double time_shield::hour_to_fsec ( double hr)

Convert hours to floating-point seconds.

Parameters
hrHours value.
Returns
Seconds as double.

Definition at line 172 of file time_conversions.mqh.

◆ hour_to_fsec() [2/2]

template<class T = int>
fts_t time_shield::hour_to_fsec ( T hr)
constexprnoexcept

Converts a timestamp from hours to floating-point seconds.

Template Parameters
TThe type of the input timestamp (default is int).
Parameters
hrTimestamp in hours.
Returns
fts_t Timestamp in floating-point seconds.

Definition at line 383 of file time_unit_conversions.hpp.

◆ hour_to_ms() [1/2]

long time_shield::hour_to_ms ( double hr)

Convert hours to milliseconds.

Parameters
hrHours value.
Returns
Milliseconds value.

Definition at line 144 of file time_conversions.mqh.

◆ hour_to_ms() [2/2]

template<class T1 = ts_ms_t, class T2>
T1 time_shield::hour_to_ms ( T2 ts)
constexprnoexcept

Converts a timestamp from hours to milliseconds.

Template Parameters
T1The type of the output timestamp (default is ts_ms_t).
T2The type of the input timestamp.
Parameters
tsTimestamp in hours.
Returns
T1 Timestamp in milliseconds.

Definition at line 294 of file time_unit_conversions.hpp.

◆ hour_to_ms_impl() [1/2]

template<class T>
ts_ms_t time_shield::hour_to_ms_impl ( T t,
std::false_type tag )
constexprnoexcept

Helper function for converting hours to milliseconds (integral version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in hours.
tagType tag used to select the integral overload (must be std::false_type).
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 283 of file time_unit_conversions.hpp.

◆ hour_to_ms_impl() [2/2]

template<class T>
ts_ms_t time_shield::hour_to_ms_impl ( T t,
std::true_type tag )
constexprnoexcept

Helper function for converting hours to milliseconds (floating-point version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in hours.
tagstd::true_type indicates a floating-point type (double or float).
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 273 of file time_unit_conversions.hpp.

◆ hour_to_sec() [1/2]

long time_shield::hour_to_sec ( double hr)

Convert hours to seconds.

Parameters
hrHours value.
Returns
Seconds value.

Definition at line 158 of file time_conversions.mqh.

◆ hour_to_sec() [2/2]

template<class T1 = ts_t, class T2>
T1 time_shield::hour_to_sec ( T2 ts)
constexprnoexcept

Converts a timestamp from hours to seconds.

Template Parameters
T1The type of the output timestamp (default is ts_t).
T2The type of the input timestamp.
Parameters
tsTimestamp in hours.
Returns
T1 Timestamp in seconds.

Definition at line 352 of file time_unit_conversions.hpp.

◆ hour_to_sec_impl() [1/2]

template<class T>
ts_t time_shield::hour_to_sec_impl ( T t,
std::false_type tag )
constexprnoexcept

Helper function for converting hours to seconds (integral version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in hours.
tagstd::false_type indicates a non-floating-point type.
Returns
ts_t Timestamp in seconds.

Definition at line 341 of file time_unit_conversions.hpp.

◆ hour_to_sec_impl() [2/2]

template<class T>
ts_t time_shield::hour_to_sec_impl ( T t,
std::true_type tag )
constexprnoexcept

Helper function for converting hours to seconds (floating-point version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in hours.
tagstd::true_type indicates a floating-point type (double or float).
Returns
ts_t Timestamp in seconds.

Definition at line 331 of file time_unit_conversions.hpp.

◆ is_first_workday_of_month() [1/4]

bool time_shield::is_first_workday_of_month ( const long ts)

Definition at line 1039 of file time_conversions.mqh.

◆ is_first_workday_of_month() [2/4]

bool time_shield::is_first_workday_of_month ( long year,
int month,
int day )

Definition at line 1015 of file time_conversions.mqh.

◆ is_first_workday_of_month() [3/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_first_workday_of_month ( ts_t ts)
inlinenoexcept

Checks whether timestamp is the first workday of the month.

Parameters
tsTimestamp in seconds.

Definition at line 145 of file workday_conversions.hpp.

◆ is_first_workday_of_month() [4/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_first_workday_of_month ( year_t year,
int month,
int day )
inlinenoexcept

Checks whether date is the first workday of the month.

Parameters
yearTarget year.
monthTarget month (1-12).
dayDay of month (1-based).

Definition at line 97 of file workday_conversions.hpp.

◆ is_first_workday_of_month_ms() [1/2]

bool time_shield::is_first_workday_of_month_ms ( const long ts_ms)

Definition at line 1055 of file time_conversions.mqh.

◆ is_first_workday_of_month_ms() [2/2]

TIME_SHIELD_CONSTEXPR bool time_shield::is_first_workday_of_month_ms ( ts_ms_t ts_ms)
inlinenoexcept

Checks whether millisecond timestamp is the first workday of the month.

Parameters
ts_msTimestamp in milliseconds.

Definition at line 151 of file workday_conversions.hpp.

◆ is_last_workday_of_month() [1/4]

bool time_shield::is_last_workday_of_month ( const long ts)

Definition at line 1047 of file time_conversions.mqh.

◆ is_last_workday_of_month() [2/4]

bool time_shield::is_last_workday_of_month ( long year,
int month,
int day )

Definition at line 1027 of file time_conversions.mqh.

◆ is_last_workday_of_month() [3/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_last_workday_of_month ( ts_t ts)
inlinenoexcept

Checks whether timestamp is the last workday of the month.

Parameters
tsTimestamp in seconds.

Definition at line 171 of file workday_conversions.hpp.

◆ is_last_workday_of_month() [4/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_last_workday_of_month ( year_t year,
int month,
int day )
inlinenoexcept

Checks whether date is the last workday of the month.

Parameters
yearTarget year.
monthTarget month (1-12).
dayDay of month (1-based).

Definition at line 122 of file workday_conversions.hpp.

◆ is_last_workday_of_month_ms() [1/2]

bool time_shield::is_last_workday_of_month_ms ( const long ts_ms)

Definition at line 1063 of file time_conversions.mqh.

◆ is_last_workday_of_month_ms() [2/2]

TIME_SHIELD_CONSTEXPR bool time_shield::is_last_workday_of_month_ms ( ts_ms_t ts_ms)
inlinenoexcept

Checks whether millisecond timestamp is the last workday of the month.

Parameters
ts_msTimestamp in milliseconds.

Definition at line 177 of file workday_conversions.hpp.

◆ is_valid_iso_week_date()

bool time_shield::is_valid_iso_week_date ( year_t iso_year,
int week,
int weekday )
inline

Validate ISO week date components.

Parameters
iso_yearISO week-numbering year.
weekISO week number.
weekdayISO weekday (1-7).
Returns
True if components form a valid ISO week date.

Definition at line 101 of file iso_week_conversions.hpp.

◆ is_valid_tz_offset()

TIME_SHIELD_CONSTEXPR bool time_shield::is_valid_tz_offset ( tz_t off)
inlinenoexcept

Check if a numeric offset is within supported bounds.

Conservative range: [-12:00, +14:00].

Definition at line 60 of file time_zone_offset_conversions.hpp.

◆ is_within_first_workdays_of_month() [1/4]

bool time_shield::is_within_first_workdays_of_month ( const long ts,
int count )

Definition at line 1043 of file time_conversions.mqh.

◆ is_within_first_workdays_of_month() [2/4]

bool time_shield::is_within_first_workdays_of_month ( long year,
int month,
int day,
int count )

Definition at line 1019 of file time_conversions.mqh.

◆ is_within_first_workdays_of_month() [3/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_within_first_workdays_of_month ( ts_t ts,
int count )
inlinenoexcept

Checks if timestamp falls within the first N workdays of the month.

Parameters
tsTimestamp in seconds.
countNumber of leading workdays to include.

Definition at line 158 of file workday_conversions.hpp.

◆ is_within_first_workdays_of_month() [4/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_within_first_workdays_of_month ( year_t year,
int month,
int day,
int count )
inlinenoexcept

Checks if date falls within the first N workdays of the month.

Parameters
yearTarget year.
monthTarget month (1-12).
dayDay of month (1-based).
countNumber of leading workdays to include.

Definition at line 106 of file workday_conversions.hpp.

◆ is_within_first_workdays_of_month_ms() [1/2]

bool time_shield::is_within_first_workdays_of_month_ms ( const long ts_ms,
int count )

Definition at line 1059 of file time_conversions.mqh.

◆ is_within_first_workdays_of_month_ms() [2/2]

TIME_SHIELD_CONSTEXPR bool time_shield::is_within_first_workdays_of_month_ms ( ts_ms_t ts_ms,
int count )
inlinenoexcept

Checks if millisecond timestamp falls within the first N workdays of the month.

Parameters
ts_msTimestamp in milliseconds.
countNumber of leading workdays to include.

Definition at line 165 of file workday_conversions.hpp.

◆ is_within_last_workdays_of_month() [1/4]

bool time_shield::is_within_last_workdays_of_month ( const long ts,
int count )

Definition at line 1051 of file time_conversions.mqh.

◆ is_within_last_workdays_of_month() [2/4]

bool time_shield::is_within_last_workdays_of_month ( long year,
int month,
int day,
int count )

Definition at line 1031 of file time_conversions.mqh.

◆ is_within_last_workdays_of_month() [3/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_within_last_workdays_of_month ( ts_t ts,
int count )
inlinenoexcept

Checks if timestamp falls within the last N workdays of the month.

Parameters
tsTimestamp in seconds.
countNumber of trailing workdays to include.

Definition at line 184 of file workday_conversions.hpp.

◆ is_within_last_workdays_of_month() [4/4]

TIME_SHIELD_CONSTEXPR bool time_shield::is_within_last_workdays_of_month ( year_t year,
int month,
int day,
int count )
inlinenoexcept

Checks if date falls within the last N workdays of the month.

Parameters
yearTarget year.
monthTarget month (1-12).
dayDay of month (1-based).
countNumber of trailing workdays to include.

Definition at line 131 of file workday_conversions.hpp.

◆ is_within_last_workdays_of_month_ms() [1/2]

bool time_shield::is_within_last_workdays_of_month_ms ( const long ts_ms,
int count )

Definition at line 1067 of file time_conversions.mqh.

◆ is_within_last_workdays_of_month_ms() [2/2]

TIME_SHIELD_CONSTEXPR bool time_shield::is_within_last_workdays_of_month_ms ( ts_ms_t ts_ms,
int count )
inlinenoexcept

Checks if millisecond timestamp falls within the last N workdays of the month.

Parameters
ts_msTimestamp in milliseconds.
countNumber of trailing workdays to include.

Definition at line 191 of file workday_conversions.hpp.

◆ iso_week_date_to_date()

DateStruct time_shield::iso_week_date_to_date ( const IsoWeekDateStruct & iso_date)
inline

Convert ISO week date to calendar date.

Parameters
iso_dateISO week date structure.
Returns
Calendar date corresponding to the ISO week date.
Exceptions
std::invalid_argumentif the ISO week date is invalid.

Definition at line 114 of file iso_week_conversions.hpp.

◆ iso_weekday_from_weekday()

TIME_SHIELD_CONSTEXPR int time_shield::iso_weekday_from_weekday ( Weekday weekday)
inlinenoexcept

Convert Weekday enum to ISO weekday (Mon=1 .. Sun=7).

Parameters
weekdayWeekday enum value.
Returns
ISO weekday number.

Definition at line 35 of file iso_week_conversions.hpp.

◆ iso_weekday_of_date()

template<class Y = year_t, class M = Month, class D = int>
TIME_SHIELD_CONSTEXPR int time_shield::iso_weekday_of_date ( Y year,
M month,
D day )
inline

Get ISO weekday for a calendar date.

Parameters
yearYear component.
monthMonth component.
dayDay component.
Returns
ISO weekday number (1=Monday .. 7=Sunday).

Definition at line 45 of file iso_week_conversions.hpp.

◆ iso_weeks_in_year()

int time_shield::iso_weeks_in_year ( year_t iso_year)
inline

Calculate number of ISO weeks in a year.

Parameters
iso_yearISO week-numbering year.
Returns
52 or 53 depending on the ISO year length.

Definition at line 91 of file iso_week_conversions.hpp.

◆ last_day_of_month() [1/2]

long time_shield::last_day_of_month ( long ts)

Alias for end_of_month.

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.

Parameters
tsTimestamp (default is current timestamp)
Returns
Last timestamp of the current month

Definition at line 1115 of file time_conversions.mqh.

◆ last_day_of_month() [2/2]

TIME_SHIELD_CONSTEXPR ts_t time_shield::last_day_of_month ( ts_t ts = time_shield::ts())
inline

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.

Parameters
tsTimestamp (default is current timestamp)
Returns
Last timestamp of the current month

Definition at line 2026 of file time_conversion_aliases.hpp.

◆ last_sunday_month_day()

int time_shield::last_sunday_month_day ( long year,
int month )

Get the day of the last Sunday for the given month and year.

Parameters
yearYear value.
monthMonth value.
Returns
Day of the last Sunday of that month.

Definition at line 1132 of file time_conversions.mqh.

◆ last_sunday_of_month()

long time_shield::last_sunday_of_month ( long ts)

Get the timestamp of the last Sunday of the month.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 of the last Sunday of the month.

Definition at line 1120 of file time_conversions.mqh.

◆ last_workday_day() [1/2]

int time_shield::last_workday_day ( long year,
int month )

Definition at line 842 of file time_conversions.mqh.

◆ last_workday_day() [2/2]

TIME_SHIELD_CONSTEXPR int time_shield::last_workday_day ( year_t year,
int month )
inlinenoexcept

Finds the last workday number within a month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 39 of file workday_conversions.hpp.

◆ min_begin() [1/2]

long time_shield::min_begin ( long ts)

Alias for start_of_min.

Get the timestamp of the beginning of the minute.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the beginning of the minute.

Definition at line 1260 of file time_conversions.mqh.

◆ min_begin() [2/2]

ts_t time_shield::min_begin ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for start_of_min function.

Get the timestamp of the beginning of the minute.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the beginning of the minute.

Definition at line 2132 of file time_conversion_aliases.hpp.

◆ min_in_hour()

int time_shield::min_in_hour ( long ts)

Alias for min_of_hour.

Get minute of hour. This function returns a value between 0 to 59.

Parameters
tsTimestamp in seconds (default: current timestamp).
Returns
Minute of hour.

Definition at line 1289 of file time_conversions.mqh.

◆ min_of_day()

int time_shield::min_of_day ( long ts)

Get the minute of the day.

Parameters
tsTimestamp in seconds.
Returns
Minute of the day (0-1439).

Definition at line 1276 of file time_conversions.mqh.

◆ min_of_hour()

int time_shield::min_of_hour ( long ts)

Get the minute of the hour.

Parameters
tsTimestamp in seconds.
Returns
Minute of the hour (0-59).

Definition at line 1283 of file time_conversions.mqh.

◆ min_since_epoch()

template<class T = int64_t>
T time_shield::min_since_epoch ( ts_t ts = time_shield::ts())
constexpr

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 206 of file unix_time_conversions.hpp.

◆ min_to_fsec() [1/2]

double time_shield::min_to_fsec ( double min)

Convert minutes to floating-point seconds.

Parameters
minMinutes value.
Returns
Seconds as double.

Definition at line 126 of file time_conversions.mqh.

◆ min_to_fsec() [2/2]

template<class T = int>
fts_t time_shield::min_to_fsec ( T min)
constexprnoexcept

Converts a timestamp from minutes to floating-point seconds.

Template Parameters
TThe type of the input timestamp (default is int).
Parameters
minTimestamp in minutes.
Returns
fts_t Timestamp in floating-point seconds.

Definition at line 249 of file time_unit_conversions.hpp.

◆ min_to_ms() [1/2]

long time_shield::min_to_ms ( double min)

Convert minutes to milliseconds.

Parameters
minMinutes value.
Returns
Milliseconds value.

Definition at line 98 of file time_conversions.mqh.

◆ min_to_ms() [2/2]

template<class T1 = ts_ms_t, class T2>
T1 time_shield::min_to_ms ( T2 ts)
constexprnoexcept

Converts a timestamp from minutes to milliseconds.

Template Parameters
T1The type of the output timestamp (default is ts_ms_t).
T2The type of the input timestamp.
Parameters
tsTimestamp in minutes.
Returns
T1 Timestamp in milliseconds.

Definition at line 161 of file time_unit_conversions.hpp.

◆ min_to_ms_impl() [1/2]

template<class T>
ts_ms_t time_shield::min_to_ms_impl ( T t,
std::false_type tag )
constexprnoexcept

Helper function for converting minutes to milliseconds (integral version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in minutes.
tagstd::false_type indicates a non-floating-point type.
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 150 of file time_unit_conversions.hpp.

◆ min_to_ms_impl() [2/2]

template<class T>
ts_ms_t time_shield::min_to_ms_impl ( T t,
std::true_type tag )
constexprnoexcept

Helper function for converting minutes to milliseconds (floating-point version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in minutes.
tagstd::true_type indicates a floating-point type (double or float).
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 140 of file time_unit_conversions.hpp.

◆ min_to_sec() [1/2]

long time_shield::min_to_sec ( double min)

Convert minutes to seconds.

Parameters
minMinutes value.
Returns
Seconds value.

Definition at line 112 of file time_conversions.mqh.

◆ min_to_sec() [2/2]

template<class T1 = ts_t, class T2>
T1 time_shield::min_to_sec ( T2 ts)
constexprnoexcept

Converts a timestamp from minutes to seconds.

Template Parameters
T1The type of the output timestamp (default is ts_t).
T2The type of the input timestamp.
Parameters
tsTimestamp in minutes.
Returns
T1 Timestamp in seconds.

Definition at line 218 of file time_unit_conversions.hpp.

◆ min_to_sec_impl() [1/2]

template<class T>
ts_t time_shield::min_to_sec_impl ( T t,
std::false_type tag )
constexprnoexcept

Helper function for converting minutes to seconds (integral version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in minutes.
tagstd::false_type indicates a non-floating-point type.
Returns
ts_t Timestamp in seconds.

Definition at line 207 of file time_unit_conversions.hpp.

◆ min_to_sec_impl() [2/2]

template<class T>
ts_t time_shield::min_to_sec_impl ( T t,
std::true_type tag )
constexprnoexcept

Helper function for converting minutes to seconds (floating-point version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in minutes.
tagstd::true_type indicates a floating-point type (double or float).
Returns
ts_t Timestamp in seconds.

Definition at line 197 of file time_unit_conversions.hpp.

◆ minutes_since_epoch()

template<class T = int64_t>
T time_shield::minutes_since_epoch ( ts_t ts = time_shield::ts())
constexpr

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 234 of file time_conversion_aliases.hpp.

◆ month_begin() [1/2]

long time_shield::month_begin ( long ts)

Alias for start_of_month.

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.

Parameters
tsTimestamp (default is current timestamp)
Returns
Timestamp at the start of the current month

Definition at line 1104 of file time_conversions.mqh.

◆ month_begin() [2/2]

TIME_SHIELD_CONSTEXPR ts_t time_shield::month_begin ( ts_t ts = time_shield::ts())
inline

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.

Parameters
tsTimestamp (default is current timestamp)
Returns
Timestamp at the start of the current month

Definition at line 2018 of file time_conversion_aliases.hpp.

◆ month_of_year()

Month time_shield::month_of_year ( long ts)

Get the month of the year.

Parameters
tsTimestamp in seconds.
Returns
Month of the year.

Definition at line 742 of file time_conversions.mqh.

◆ ms_of_sec() [1/2]

int time_shield::ms_of_sec ( double ts)

Get the millisecond part of a floating-point timestamp.

Parameters
tsTimestamp in seconds with fractional part.
Returns
Milliseconds of the second.

Definition at line 54 of file time_conversions.mqh.

◆ ms_of_sec() [2/2]

template<class T = int>
T time_shield::ms_of_sec ( fts_t ts)
constexprnoexcept

Get the millisecond part of the second from a floating-point timestamp.

Template Parameters
TType of the returned value (default is int).
Parameters
tsTimestamp in floating-point seconds.
Returns
T Millisecond part of the second.

Definition at line 46 of file time_unit_conversions.hpp.

◆ ms_of_ts() [1/2]

int time_shield::ms_of_ts ( long ts_ms)

Get the millisecond part of a millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Milliseconds component.

Definition at line 62 of file time_conversions.mqh.

◆ ms_of_ts() [2/2]

template<class T = int>
T time_shield::ms_of_ts ( ts_ms_t ts)
constexprnoexcept

Get the millisecond part of the timestamp.

Template Parameters
TType of the returned value (default is int).
Parameters
tsTimestamp in milliseconds.
Returns
T Millisecond part of the timestamp.

Definition at line 56 of file time_unit_conversions.hpp.

◆ ms_to_fsec() [1/2]

double time_shield::ms_to_fsec ( long ms)

Convert milliseconds to floating-point seconds.

Parameters
msTimestamp in milliseconds.
Returns
Seconds as double.

Definition at line 87 of file time_conversions.mqh.

◆ ms_to_fsec() [2/2]

template<class T = ts_ms_t>
fts_t time_shield::ms_to_fsec ( T ts_ms)
constexprnoexcept

Converts a timestamp from milliseconds to floating-point seconds.

Template Parameters
TThe type of the input timestamp (default is ts_ms_t).
Parameters
ts_msTimestamp in milliseconds.
Returns
fts_t Timestamp in floating-point seconds.

Definition at line 126 of file time_unit_conversions.hpp.

◆ ms_to_hour() [1/2]

int time_shield::ms_to_hour ( long ms)

Convert milliseconds to hours (integer part).

Parameters
msMilliseconds value.
Returns
Hours value.

Definition at line 151 of file time_conversions.mqh.

◆ ms_to_hour() [2/2]

template<class T1 = int, class T2 = ts_ms_t>
T1 time_shield::ms_to_hour ( T2 ts)
constexprnoexcept

Converts a timestamp from milliseconds to hours.

Template Parameters
T1The type of the output timestamp (default is int).
T2The type of the input timestamp (default is ts_ms_t).
Parameters
tsTimestamp in milliseconds.
Returns
T1 Timestamp in hours.

Definition at line 316 of file time_unit_conversions.hpp.

◆ ms_to_min() [1/2]

int time_shield::ms_to_min ( long ms)

Convert milliseconds to minutes (integer part).

Parameters
msMilliseconds value.
Returns
Minutes value.

Definition at line 105 of file time_conversions.mqh.

◆ ms_to_min() [2/2]

template<class T1 = int, class T2 = ts_ms_t>
T1 time_shield::ms_to_min ( T2 ts)
constexprnoexcept

Converts a timestamp from milliseconds to minutes.

Template Parameters
T1The type of the output timestamp (default is int).
T2The type of the input timestamp (default is ts_ms_t).
Parameters
tsTimestamp in milliseconds.
Returns
T1 Timestamp in minutes.

Definition at line 183 of file time_unit_conversions.hpp.

◆ ms_to_sec() [1/2]

long time_shield::ms_to_sec ( long ms)

Convert milliseconds to seconds (integer part).

Parameters
msTimestamp in milliseconds.
Returns
Seconds value.

Definition at line 80 of file time_conversions.mqh.

◆ ms_to_sec() [2/2]

template<class T1 = ts_t, class T2 = ts_ms_t>
T1 time_shield::ms_to_sec ( T2 ts_ms)
constexprnoexcept

Converts a timestamp from milliseconds to seconds.

Template Parameters
T1The type of the output timestamp (default is ts_t).
T2The type of the input timestamp (default is ts_ms_t).
Parameters
ts_msTimestamp in milliseconds.
Returns
T1 Timestamp in seconds.

Definition at line 117 of file time_unit_conversions.hpp.

◆ next_day()

long time_shield::next_day ( long ts,
int days = 1 )

Add days to a timestamp without adjusting to start of day.

Parameters
tsTimestamp in seconds.
daysNumber of days to add (default 1).
Returns
Timestamp shifted forward by the given days.

Definition at line 518 of file time_conversions.mqh.

◆ next_day_from_unix_day() [1/2]

long time_shield::next_day_from_unix_day ( long uday)

Alias for start_of_next_day_from_unix_day.

Get start of next day timestamp from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in seconds.

Definition at line 1488 of file time_conversions.mqh.

◆ next_day_from_unix_day() [2/2]

template<class T = ts_t>
T time_shield::next_day_from_unix_day ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the next UNIX day.

Definition at line 188 of file time_conversion_aliases.hpp.

◆ next_day_from_unix_day_ms()

template<class T = ts_ms_t>
T time_shield::next_day_from_unix_day_ms ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_ms_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the next UNIX day.

Definition at line 211 of file time_conversion_aliases.hpp.

◆ next_day_ms()

long time_shield::next_day_ms ( long ts_ms,
int days = 1 )

Add days to a millisecond timestamp without adjusting to start of day.

Parameters
ts_msTimestamp in milliseconds.
daysNumber of days to add (default 1).
Returns
Timestamp shifted forward by the given days in milliseconds.

Definition at line 526 of file time_conversions.mqh.

◆ next_day_start() [1/2]

long time_shield::next_day_start ( long ts,
int days = 1 )

Alias for start_of_next_day.

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.

Parameters
tsThe current timestamp in seconds.
daysThe number of days after the current day (default is 1).
Returns
The timestamp in seconds representing the beginning of the specified future day.

Definition at line 500 of file time_conversions.mqh.

◆ next_day_start() [2/2]

template<class T = int>
ts_t time_shield::next_day_start ( ts_t ts,
T days = 1 )
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.

Parameters
tsThe current timestamp in seconds.
daysThe number of days after the current day (default is 1).
Returns
The timestamp in seconds representing the beginning of the specified future day.

Definition at line 1797 of file time_conversion_aliases.hpp.

◆ next_day_start_ms() [1/2]

long time_shield::next_day_start_ms ( long ts_ms,
int days = 1 )

Alias for start_of_next_day_ms.

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.

Parameters
ts_msThe current timestamp in milliseconds.
daysThe number of days after the current day (default is 1).
Returns
The timestamp in milliseconds representing the beginning of the specified future day.

Definition at line 512 of file time_conversions.mqh.

◆ next_day_start_ms() [2/2]

template<class T = int>
ts_ms_t time_shield::next_day_start_ms ( ts_ms_t ts_ms,
T days = 1 )
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.

Parameters
ts_msThe current timestamp in milliseconds.
daysThe number of days after the current day (default is 1).
Returns
The timestamp in milliseconds representing the beginning of the specified future day.

Definition at line 1806 of file time_conversion_aliases.hpp.

◆ next_day_unix_day() [1/2]

long time_shield::next_day_unix_day ( long uday)

Alias for start_of_next_day_from_unix_day.

Get start of next day timestamp from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in seconds.

Definition at line 1472 of file time_conversions.mqh.

◆ next_day_unix_day() [2/2]

template<class T = ts_t>
T time_shield::next_day_unix_day ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the next UNIX day.

Definition at line 195 of file time_conversion_aliases.hpp.

◆ next_day_unix_day_ms() [1/2]

long time_shield::next_day_unix_day_ms ( long uday)

Alias for start_of_next_day_from_unix_day_ms.

Get start of next day timestamp in ms from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in milliseconds.

Definition at line 1480 of file time_conversions.mqh.

◆ next_day_unix_day_ms() [2/2]

template<class T = ts_ms_t>
T time_shield::next_day_unix_day_ms ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_ms_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the next UNIX day.

Definition at line 218 of file time_conversion_aliases.hpp.

◆ next_day_unixday() [1/2]

long time_shield::next_day_unixday ( long uday)

Alias for start_of_next_day_from_unix_day.

Get start of next day timestamp from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in seconds.

Definition at line 1476 of file time_conversions.mqh.

◆ next_day_unixday() [2/2]

template<class T = ts_t>
T time_shield::next_day_unixday ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the next UNIX day.

Definition at line 202 of file time_conversion_aliases.hpp.

◆ next_day_unixday_ms() [1/2]

long time_shield::next_day_unixday_ms ( long uday)

Alias for start_of_next_day_from_unix_day_ms.

Get start of next day timestamp in ms from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in milliseconds.

Definition at line 1484 of file time_conversions.mqh.

◆ next_day_unixday_ms() [2/2]

template<class T = ts_ms_t>
T time_shield::next_day_unixday_ms ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_ms_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the next UNIX day.

Definition at line 225 of file time_conversion_aliases.hpp.

◆ ns_of_sec() [1/2]

int time_shield::ns_of_sec ( double ts)

Get the nanosecond part of a floating-point timestamp.

Parameters
tsTimestamp in seconds with fractional part.
Returns
Nanoseconds of the second.

Definition at line 38 of file time_conversions.mqh.

◆ ns_of_sec() [2/2]

template<class T = int>
T time_shield::ns_of_sec ( fts_t ts)
constexprnoexcept

Get the nanosecond part of the second from a floating-point timestamp.

Template Parameters
TType of the returned value (default is int).
Parameters
tsTimestamp in floating-point seconds.
Returns
T Nanosecond part of the second.

Definition at line 26 of file time_unit_conversions.hpp.

◆ num_days_in_month() [1/3]

int time_shield::num_days_in_month ( long ts)

Alias for num_days_in_month_ts.

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.

Parameters
tsThe timestamp to extract month and year from.
Returns
The number of days in the month of the given timestamp.

Definition at line 823 of file time_conversions.mqh.

◆ num_days_in_month() [2/3]

int time_shield::num_days_in_month ( long year,
int month )

Get the number of days in a month.

Parameters
yearYear value.
monthMonth value.
Returns
Number of days in the month.

Definition at line 795 of file time_conversions.mqh.

◆ num_days_in_month() [3/3]

template<class T1 = int>
T1 time_shield::num_days_in_month ( ts_t ts = time_shield::ts())
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.

Parameters
tsThe timestamp to extract month and year from.
Returns
The number of days in the month of the given timestamp.

Definition at line 1724 of file time_conversion_aliases.hpp.

◆ num_days_in_month_ts()

int time_shield::num_days_in_month_ts ( long ts)

Get the number of days in the month of a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Number of days in that month.

Definition at line 812 of file time_conversions.mqh.

◆ num_days_in_year() [1/2]

int time_shield::num_days_in_year ( long year)

Get number of days in a year.

Parameters
yearYear value.
Returns
Days in the year.

Definition at line 1074 of file time_conversions.mqh.

◆ num_days_in_year() [2/2]

template<class T1 = int, class T2 = year_t>
TIME_SHIELD_CONSTEXPR T1 time_shield::num_days_in_year ( T2 year)
inlinenoexcept

Get the number of days in a year.

Parameters
yearYear.
Returns
Number of days in the given year.

Definition at line 48 of file date_conversions.hpp.

◆ num_days_in_year_ts() [1/2]

int time_shield::num_days_in_year_ts ( long ts)

Get number of days in the year of the timestamp.

Parameters
tsTimestamp in seconds.
Returns
Days in the year of the timestamp.

Definition at line 1086 of file time_conversions.mqh.

◆ num_days_in_year_ts() [2/2]

template<class T = int>
TIME_SHIELD_CONSTEXPR T time_shield::num_days_in_year_ts ( ts_t ts = time_shield::ts())
inline

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.

Parameters
tsTimestamp.
Returns
Number of days in the current year.

Definition at line 60 of file date_conversions.hpp.

◆ offset_hm()

TIME_SHIELD_CONSTEXPR tz_t time_shield::offset_hm ( int hour,
int min = 0 )
inlinenoexcept

Alias for tz_offset_hm.

Build offset in seconds from hours/minutes.

Parameters
hourSigned hours (e.g. -3, +5).
minMinutes (0..59).

Definition at line 2173 of file time_conversion_aliases.hpp.

◆ parse_iso_week_date() [1/2]

bool time_shield::parse_iso_week_date ( const char * input,
std::size_t length,
IsoWeekDateStruct & iso_date )
inlinenoexcept

Parse ISO week date string buffer.

Parameters
inputPointer to character buffer (may be not null-terminated).
lengthLength of the buffer.
iso_dateOutput ISO week date structure.
Returns
True if parsing succeeded and produced a valid ISO week date; otherwise false.

Definition at line 157 of file iso_week_conversions.hpp.

◆ parse_iso_week_date() [2/2]

bool time_shield::parse_iso_week_date ( const std::string & input,
IsoWeekDateStruct & iso_date )
inlinenoexcept

Parse ISO week date string.

Parameters
inputInput string containing ISO week date.
iso_dateOutput ISO week date structure.
Returns
True if parsing succeeded and produced a valid ISO week date; otherwise false.

Definition at line 233 of file iso_week_conversions.hpp.

◆ previous_day_start() [1/2]

long time_shield::previous_day_start ( long ts,
int days = 1 )

Alias for start_of_prev_day.

Get timestamp of the start of the previous day.

This function returns the timestamp at the start of the previous day.

Parameters
tsTimestamp of the current day.
daysNumber of days to go back (default is 1).
Returns
Timestamp of the start of the previous day.

Definition at line 466 of file time_conversions.mqh.

◆ previous_day_start() [2/2]

template<class T = int>
ts_t time_shield::previous_day_start ( ts_t ts = time_shield::ts(),
T days = 1 )
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.

Parameters
tsTimestamp of the current day.
daysNumber of days to go back (default is 1).
Returns
Timestamp of the start of the previous day.

Definition at line 1766 of file time_conversion_aliases.hpp.

◆ saturday_begin() [1/2]

long time_shield::saturday_begin ( long ts)

Alias for start_of_saturday.

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.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the start of Saturday.

Definition at line 1249 of file time_conversions.mqh.

◆ saturday_begin() [2/2]

ts_t time_shield::saturday_begin ( ts_t ts = time_shield::ts())
constexpr

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.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the start of Saturday.

Definition at line 2124 of file time_conversion_aliases.hpp.

◆ sec_of_day() [1/4]

int time_shield::sec_of_day ( int hour,
int min,
int sec )

Get second of day from hours, minutes and seconds.

Parameters
hourHour value.
minMinute value.
secSecond value.
Returns
Second of the day.

Definition at line 1528 of file time_conversions.mqh.

◆ sec_of_day() [2/4]

int time_shield::sec_of_day ( long ts)

Get second of day from timestamp.

Parameters
tsTimestamp in seconds.
Returns
Second of the day.

Definition at line 1512 of file time_conversions.mqh.

◆ sec_of_day() [3/4]

template<class T1 = int, class T2 = int>
T1 time_shield::sec_of_day ( T2 hour,
T2 min,
T2 sec )
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.

Template Parameters
T1The return type of the function (default is int).
T2The type of the hour, minute, and second parameters (default is int).
Parameters
hourHour of the day.
minMinute of the hour.
secSecond of the minute.
Returns
Second of the day.

Definition at line 245 of file unix_time_conversions.hpp.

◆ sec_of_day() [4/4]

template<class T = int>
T time_shield::sec_of_day ( ts_t ts = time_shield::ts())
constexprnoexcept

Get the second of the day.

This function returns a value from 0 to MAX_SEC_PER_DAY representing the second of the day.

Template Parameters
TThe return type of the function (default is int).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Second of the day.

Definition at line 218 of file unix_time_conversions.hpp.

◆ sec_of_day_ms() [1/2]

int time_shield::sec_of_day_ms ( long ts_ms)

Get second of day from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Second of the day.

Definition at line 1519 of file time_conversions.mqh.

◆ sec_of_day_ms() [2/2]

template<class T = int>
T time_shield::sec_of_day_ms ( ts_ms_t ts_ms)
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.

Template Parameters
TThe return type of the function (default is int).
Parameters
ts_msTimestamp in milliseconds.
Returns
Second of the day.

Definition at line 230 of file unix_time_conversions.hpp.

◆ sec_of_hour()

template<class T = int>
T time_shield::sec_of_hour ( ts_t ts = time_shield::ts())
constexpr

Get the second of the hour.

This function returns a value between 0 and 3599 representing the second of the hour.

Template Parameters
TThe return type of the function (default is int).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Second of the hour.

Definition at line 274 of file unix_time_conversions.hpp.

◆ sec_of_min()

template<class T = int>
T time_shield::sec_of_min ( ts_t ts = time_shield::ts())
constexpr

Get the second of the minute.

This function returns a value between 0 and 59 representing the second of the minute.

Template Parameters
TThe return type of the function (default is int).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Second of the minute.

Definition at line 262 of file unix_time_conversions.hpp.

◆ sec_to_fhour() [1/2]

double time_shield::sec_to_fhour ( long sec)

Convert seconds to floating-point hours.

Parameters
secSeconds value.
Returns
Hours as double.

Definition at line 179 of file time_conversions.mqh.

◆ sec_to_fhour() [2/2]

template<class T = ts_t>
double time_shield::sec_to_fhour ( T ts)
constexprnoexcept

Converts a timestamp from seconds to floating-point hours.

Template Parameters
TThe type of the input timestamp (default is ts_t).
Parameters
tsTimestamp in seconds.
Returns
double Timestamp in floating-point hours.

Definition at line 392 of file time_unit_conversions.hpp.

◆ sec_to_fmin() [1/2]

double time_shield::sec_to_fmin ( long sec)

Convert seconds to floating-point minutes.

Parameters
secSeconds value.
Returns
Minutes as double.

Definition at line 133 of file time_conversions.mqh.

◆ sec_to_fmin() [2/2]

template<class T = ts_t>
double time_shield::sec_to_fmin ( T ts)
constexprnoexcept

Converts a timestamp from seconds to floating-point minutes.

Template Parameters
TThe type of the input timestamp (default is ts_t).
Parameters
tsTimestamp in seconds.
Returns
double Timestamp in floating-point minutes.

Definition at line 258 of file time_unit_conversions.hpp.

◆ sec_to_hour() [1/2]

int time_shield::sec_to_hour ( long sec)

Convert seconds to hours (integer part).

Parameters
secSeconds value.
Returns
Hours value.

Definition at line 165 of file time_conversions.mqh.

◆ sec_to_hour() [2/2]

template<class T1 = int, class T2 = ts_t>
T1 time_shield::sec_to_hour ( T2 ts)
constexprnoexcept

Converts a timestamp from seconds to hours.

Template Parameters
T1The type of the output timestamp (default is int).
T2The type of the input timestamp (default is ts_t).
Parameters
tsTimestamp in seconds.
Returns
T1 Timestamp in hours.

Definition at line 374 of file time_unit_conversions.hpp.

◆ sec_to_min() [1/2]

int time_shield::sec_to_min ( long sec)

Convert seconds to minutes (integer part).

Parameters
secSeconds value.
Returns
Minutes value.

Definition at line 119 of file time_conversions.mqh.

◆ sec_to_min() [2/2]

template<class T1 = int, class T2 = ts_t>
T1 time_shield::sec_to_min ( T2 ts)
constexprnoexcept

Converts a timestamp from seconds to minutes.

Template Parameters
T1The type of the output timestamp (default is int).
T2The type of the input timestamp (default is ts_t).
Parameters
tsTimestamp in seconds.
Returns
T1 Timestamp in minutes.

Definition at line 240 of file time_unit_conversions.hpp.

◆ sec_to_ms() [1/2]

long time_shield::sec_to_ms ( double sec)

Convert seconds to milliseconds.

Parameters
secTimestamp in seconds.
Returns
Milliseconds value.

Definition at line 73 of file time_conversions.mqh.

◆ sec_to_ms() [2/2]

template<class T1 = ts_ms_t, class T2>
T1 time_shield::sec_to_ms ( T2 ts)
constexprnoexcept

Converts a timestamp from seconds to milliseconds.

Template Parameters
T1The type of the output timestamp (default is ts_ms_t).
T2The type of the input timestamp.
Parameters
tsTimestamp in seconds.
Returns
T1 Timestamp in milliseconds.

Definition at line 88 of file time_unit_conversions.hpp.

◆ sec_to_ms_impl() [1/2]

template<class T>
ts_ms_t time_shield::sec_to_ms_impl ( T t,
std::false_type tag )
constexprnoexcept

Helper function for converting seconds to milliseconds (integral version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in seconds.
tagstd::false_type indicates a non-floating-point type.
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 77 of file time_unit_conversions.hpp.

◆ sec_to_ms_impl() [2/2]

template<class T>
ts_ms_t time_shield::sec_to_ms_impl ( T t,
std::true_type tag )
constexprnoexcept

Helper function for converting seconds to milliseconds (floating-point version).

Template Parameters
TType of the input timestamp.
Parameters
tTimestamp in seconds.
tagstd::true_type indicates a floating-point type.
Returns
ts_ms_t Timestamp in milliseconds.

Definition at line 67 of file time_unit_conversions.hpp.

◆ start_day_sec()

ts_t time_shield::start_day_sec ( ts_ms_t ts_ms = time_shield::ts_ms())
constexprnoexcept

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
Start of the day timestamp in seconds.

Definition at line 1780 of file time_conversion_aliases.hpp.

◆ start_of_day()

long time_shield::start_of_day ( long ts)

Get the start of the day for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 of the same day.

Definition at line 448 of file time_conversions.mqh.

◆ start_of_day_from_unix_day() [1/2]

long time_shield::start_of_day_from_unix_day ( long uday)

Alias for unix_day_to_timestamp.

Convert UNIX day to timestamp in seconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day.

Definition at line 1409 of file time_conversions.mqh.

◆ start_of_day_from_unix_day() [2/2]

template<class T = ts_t>
T time_shield::start_of_day_from_unix_day ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts 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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the specified UNIX day.

Definition at line 149 of file time_conversion_aliases.hpp.

◆ start_of_day_from_unix_day_ms() [1/2]

long time_shield::start_of_day_from_unix_day_ms ( long uday)

Alias for unix_day_to_timestamp_ms.

Convert UNIX day to timestamp in milliseconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day in milliseconds.

Definition at line 1432 of file time_conversions.mqh.

◆ start_of_day_from_unix_day_ms() [2/2]

template<class T = ts_t>
T time_shield::start_of_day_from_unix_day_ms ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts_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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the specified UNIX day.

Definition at line 179 of file time_conversion_aliases.hpp.

◆ start_of_day_ms()

long time_shield::start_of_day_ms ( long ts_ms)

Get the start of the day for a millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the same day.

Definition at line 482 of file time_conversions.mqh.

◆ start_of_day_sec()

long time_shield::start_of_day_sec ( long ts_ms)

Get the start of the day in seconds from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00 of the same day in seconds.

Definition at line 471 of file time_conversions.mqh.

◆ start_of_first_workday_month() [1/4]

long time_shield::start_of_first_workday_month ( long ts)

Get start timestamp of the first workday of the month containing timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 of the first workday or ERROR_TIMESTAMP.

Definition at line 884 of file time_conversions.mqh.

◆ start_of_first_workday_month() [2/4]

long time_shield::start_of_first_workday_month ( long year,
int month )

Get start timestamp of the first workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 00:00:00 of the first workday or ERROR_TIMESTAMP.

Definition at line 865 of file time_conversions.mqh.

◆ start_of_first_workday_month() [3/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_first_workday_month ( ts_t ts = time_shield::ts())
inlinenoexcept

Returns start-of-day timestamp for the first workday of month derived from timestamp.

Parameters
tsTimestamp in seconds.

Definition at line 220 of file workday_conversions.hpp.

◆ start_of_first_workday_month() [4/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_first_workday_month ( year_t year,
int month )
inlinenoexcept

Returns start-of-day timestamp for the first workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 198 of file workday_conversions.hpp.

◆ start_of_first_workday_month_ms() [1/4]

long time_shield::start_of_first_workday_month_ms ( long ts_ms)

Get start timestamp in milliseconds of the first workday of the month containing timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the first workday or ERROR_TIMESTAMP.

Definition at line 891 of file time_conversions.mqh.

◆ start_of_first_workday_month_ms() [2/4]

long time_shield::start_of_first_workday_month_ms ( long year,
int month )

Get start timestamp in milliseconds of the first workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 00:00:00.000 of the first workday or ERROR_TIMESTAMP.

Definition at line 875 of file time_conversions.mqh.

◆ start_of_first_workday_month_ms() [3/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_first_workday_month_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inlinenoexcept

Returns start-of-day millisecond timestamp for the first workday of month derived from millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.

Definition at line 226 of file workday_conversions.hpp.

◆ start_of_first_workday_month_ms() [4/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_first_workday_month_ms ( year_t year,
int month )
inlinenoexcept

Returns start-of-day millisecond timestamp for the first workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 209 of file workday_conversions.hpp.

◆ start_of_hour()

long time_shield::start_of_hour ( long ts)

Get the start of the hour for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at HH:00:00 of the same hour.

Definition at line 1144 of file time_conversions.mqh.

◆ start_of_hour_ms()

long time_shield::start_of_hour_ms ( long ts_ms)

Get the start of the hour for a millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at HH:00:00.000 of the hour.

Definition at line 1166 of file time_conversions.mqh.

◆ start_of_hour_sec()

long time_shield::start_of_hour_sec ( long ts_ms)

Get the start of the hour in seconds from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at HH:00:00 of the hour in seconds.

Definition at line 1155 of file time_conversions.mqh.

◆ start_of_last_workday_month() [1/4]

long time_shield::start_of_last_workday_month ( long ts)

Get start timestamp of the last workday of the month containing timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 of the last workday or ERROR_TIMESTAMP.

Definition at line 952 of file time_conversions.mqh.

◆ start_of_last_workday_month() [2/4]

long time_shield::start_of_last_workday_month ( long year,
int month )

Get start timestamp of the last workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 00:00:00 of the last workday or ERROR_TIMESTAMP.

Definition at line 933 of file time_conversions.mqh.

◆ start_of_last_workday_month() [3/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_last_workday_month ( ts_t ts = time_shield::ts())
inlinenoexcept

Returns start-of-day timestamp for the last workday of month derived from timestamp.

Parameters
tsTimestamp in seconds.

Definition at line 292 of file workday_conversions.hpp.

◆ start_of_last_workday_month() [4/4]

TIME_SHIELD_CONSTEXPR ts_t time_shield::start_of_last_workday_month ( year_t year,
int month )
inlinenoexcept

Returns start-of-day timestamp for the last workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 270 of file workday_conversions.hpp.

◆ start_of_last_workday_month_ms() [1/4]

long time_shield::start_of_last_workday_month_ms ( long ts_ms)

Get start timestamp in milliseconds of the last workday of the month containing timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the last workday or ERROR_TIMESTAMP.

Definition at line 959 of file time_conversions.mqh.

◆ start_of_last_workday_month_ms() [2/4]

long time_shield::start_of_last_workday_month_ms ( long year,
int month )

Get start timestamp in milliseconds of the last workday of a month.

Parameters
yearYear value.
monthMonth value.
Returns
Timestamp at 00:00:00.000 of the last workday or ERROR_TIMESTAMP.

Definition at line 943 of file time_conversions.mqh.

◆ start_of_last_workday_month_ms() [3/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_last_workday_month_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inlinenoexcept

Returns start-of-day millisecond timestamp for the last workday of month derived from millisecond timestamp.

Parameters
ts_msTimestamp in milliseconds.

Definition at line 298 of file workday_conversions.hpp.

◆ start_of_last_workday_month_ms() [4/4]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::start_of_last_workday_month_ms ( year_t year,
int month )
inlinenoexcept

Returns start-of-day millisecond timestamp for the last workday of month.

Parameters
yearTarget year.
monthTarget month (1-12).

Definition at line 281 of file workday_conversions.hpp.

◆ start_of_min()

long time_shield::start_of_min ( long ts)

Get the start of the minute for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at mm:00 of the same minute.

Definition at line 1254 of file time_conversions.mqh.

◆ start_of_month()

long time_shield::start_of_month ( long ts)

Get the timestamp at the start of the month.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 on the first day of the month.

Definition at line 1098 of file time_conversions.mqh.

◆ start_of_next_day()

long time_shield::start_of_next_day ( long ts,
int days = 1 )

Get the start of the next day.

Parameters
tsTimestamp in seconds.
daysNumber of days ahead (default 1).
Returns
Timestamp at 00:00:00 of the next day.

Definition at line 494 of file time_conversions.mqh.

◆ start_of_next_day_from_unix_day() [1/2]

long time_shield::start_of_next_day_from_unix_day ( long uday)

Get start of next day timestamp from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in seconds.

Definition at line 1459 of file time_conversions.mqh.

◆ start_of_next_day_from_unix_day() [2/2]

template<class T = ts_ms_t>
T time_shield::start_of_next_day_from_unix_day ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the next UNIX day.

Definition at line 181 of file unix_time_conversions.hpp.

◆ start_of_next_day_from_unix_day_ms() [1/2]

long time_shield::start_of_next_day_from_unix_day_ms ( long uday)

Get start of next day timestamp in ms from UNIX day.

Parameters
udayUNIX day value.
Returns
Timestamp at start of next day in milliseconds.

Definition at line 1466 of file time_conversions.mqh.

◆ start_of_next_day_from_unix_day_ms() [2/2]

template<class T = ts_ms_t>
T time_shield::start_of_next_day_from_unix_day_ms ( uday_t unix_day)
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).

Template Parameters
TThe return type of the function (default is ts_ms_t).
Parameters
unix_dayThe number of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the next UNIX day.

Definition at line 194 of file unix_time_conversions.hpp.

◆ start_of_next_day_ms()

long time_shield::start_of_next_day_ms ( long ts_ms,
int days = 1 )

Get the start of the next day in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
daysNumber of days ahead (default 1).
Returns
Timestamp at 00:00:00.000 of the next day in milliseconds.

Definition at line 506 of file time_conversions.mqh.

◆ start_of_period()

long time_shield::start_of_period ( int p,
long ts )

Get the start of a period.

Parameters
pPeriod length in seconds.
tsTimestamp (default current). Use time_utils.ts().
Returns
Timestamp of the start of the period.

Definition at line 1295 of file time_conversions.mqh.

◆ start_of_prev_day()

long time_shield::start_of_prev_day ( long ts,
int days = 1 )

Get the start of the previous day.

Parameters
tsTimestamp in seconds.
daysNumber of days to go back (default 1).
Returns
Timestamp at 00:00:00 of the previous day.

Definition at line 460 of file time_conversions.mqh.

◆ start_of_saturday()

long time_shield::start_of_saturday ( long ts)

Get the start of Saturday for the week of the timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 on Saturday of the current week.

Definition at line 1243 of file time_conversions.mqh.

◆ start_of_week()

long time_shield::start_of_week ( long ts)

Get the start of the week (Sunday).

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 on Sunday of the current week.

Definition at line 1221 of file time_conversions.mqh.

◆ start_of_year()

long time_shield::start_of_year ( long ts)

Get the start of the year for a timestamp.

Parameters
tsTimestamp in seconds.
Returns
Timestamp at 00:00:00 on January 1st of the year.

Definition at line 639 of file time_conversions.mqh.

◆ start_of_year_date()

long time_shield::start_of_year_date ( long year)

Get the timestamp for the start of the specified year.

Parameters
yearYear value.
Returns
Timestamp at 00:00:00 on January 1st of the given year.

Definition at line 680 of file time_conversions.mqh.

◆ start_of_year_date_ms()

long time_shield::start_of_year_date_ms ( long year)

Get the timestamp in milliseconds for the start of the specified year.

Parameters
yearYear value.
Returns
Timestamp at 00:00:00 on January 1st in milliseconds.

Definition at line 709 of file time_conversions.mqh.

◆ start_of_year_ms()

long time_shield::start_of_year_ms ( long ts_ms)

Get the start of the year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00 on January 1st in milliseconds.

Definition at line 665 of file time_conversions.mqh.

◆ timestamp() [1/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 812 of file time_conversion_aliases.hpp.

◆ timestamp() [2/6]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp ( const T & date_time)
inline

Alias for dt_to_timestamp function.

Converts a date-time structure 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).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 791 of file time_conversion_aliases.hpp.

◆ timestamp() [3/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp ( year_t year,
int month,
int day )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 609 of file time_conversion_aliases.hpp.

◆ timestamp() [4/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 629 of file time_conversion_aliases.hpp.

◆ timestamp() [5/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 650 of file time_conversion_aliases.hpp.

◆ timestamp() [6/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 672 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [1/7]

TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp_ms ( const std::tm * timeinfo)
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).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp in milliseconds representing the given date and time.

Definition at line 1396 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [2/7]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::timestamp_ms ( const T & date_time)
inline

Alias for dt_to_timestamp_ms function.

Converts a date-time structure to a timestamp in milliseconds.

This function converts a given date and time structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1359 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [3/7]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms ( year_t year,
int month,
int day )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1140 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [4/7]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1158 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [5/7]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1177 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [6/7]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1197 of file time_conversion_aliases.hpp.

◆ timestamp_ms() [7/7]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::timestamp_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec,
int ms )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
msThe millisecond value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1218 of file time_conversion_aliases.hpp.

◆ tm_to_fts()

TIME_SHIELD_CONSTEXPR auto time_shield::tm_to_fts ( const std::tm * timeinfo) -> decltype(tm_to_ftimestamp(timeinfo))
inline

Alias for tm_to_ftimestamp.

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).

Parameters
timeinfoPointer to the std::tm structure containing the date and time.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1530 of file time_conversion_aliases.hpp.

◆ tm_to_ts()

TIME_SHIELD_CONSTEXPR auto time_shield::tm_to_ts ( const std::tm * timeinfo) -> decltype(tm_to_timestamp(timeinfo))
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 280 of file time_conversion_aliases.hpp.

◆ tm_to_ts_ms()

TIME_SHIELD_CONSTEXPR auto time_shield::tm_to_ts_ms ( const std::tm * timeinfo) -> decltype(tm_to_timestamp_ms(timeinfo))
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).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp in milliseconds representing the given date and time.

Definition at line 1375 of file time_conversion_aliases.hpp.

◆ to_date_time()

DateTimeStruct time_shield::to_date_time ( long ts)

Convert a timestamp to a DateTimeStruct.

Parameters
tsTimestamp in seconds since UNIX epoch.
Returns
Filled DateTimeStruct.

Definition at line 274 of file time_conversions.mqh.

◆ to_date_time_mql()

MqlDateTime time_shield::to_date_time_mql ( long ts)

Convert a timestamp to the standard MqlDateTime structure.

Parameters
tsTimestamp in seconds since UNIX epoch.
Returns
Filled MqlDateTime structure.

Definition at line 295 of file time_conversions.mqh.

◆ to_date_time_ms()

DateTimeStruct time_shield::to_date_time_ms ( long ts_ms)

Convert a timestamp in milliseconds to DateTimeStruct.

Parameters
ts_msTimestamp in milliseconds since UNIX epoch.
Returns
Filled DateTimeStruct with millisecond part.

Definition at line 308 of file time_conversions.mqh.

◆ to_dt() [1/3]

DateTimeStruct time_shield::to_dt ( long ts)

Alias for to_date_time.

Converts a timestamp to a date-time structure.

This function converts a timestamp (usually an integer representing seconds since epoch) to a custom date-time structure. The default type for the timestamp is int64_t.

Template Parameters
T1The date-time structure type to be returned.
T2The type of the timestamp (default is int64_t).
Parameters
tsThe timestamp to be converted.
Returns
A date-time structure of type T1.

Definition at line 290 of file time_conversions.mqh.

◆ to_dt() [2/3]

template<class T1, class T2 = ts_t>
T1 time_shield::to_dt ( T2 ts)

Alias for to_date_time function.

Converts a timestamp to a date-time structure.

This function converts a timestamp (usually an integer representing seconds since epoch) to a custom date-time structure. The default type for the timestamp is int64_t.

Template Parameters
T1The date-time structure type to be returned.
T2The type of the timestamp (default is int64_t).
Parameters
tsThe timestamp to be converted.
Returns
A date-time structure of type T1.

Definition at line 300 of file time_conversion_aliases.hpp.

◆ to_dt() [3/3]

auto time_shield::to_dt ( ts_t ts) -> decltype(to_date_time(ts))
inline

Alias for to_date_time function.

Converts a timestamp to a date-time structure.

This function converts a timestamp (usually an integer representing seconds since epoch) to a custom date-time structure. The default type for the timestamp is int64_t.

Template Parameters
T1The date-time structure type to be returned.
T2The type of the timestamp (default is int64_t).
Parameters
tsThe timestamp to be converted.
Returns
A date-time structure of type T1.

Definition at line 315 of file time_conversion_aliases.hpp.

◆ to_dt_ms() [1/3]

DateTimeStruct time_shield::to_dt_ms ( long ts_ms)

Alias for to_date_time_ms.

Convert a timestamp in milliseconds to DateTimeStruct.

Parameters
ts_msTimestamp in milliseconds since UNIX epoch.
Returns
Filled DateTimeStruct with millisecond part.

Definition at line 316 of file time_conversions.mqh.

◆ to_dt_ms() [2/3]

template<class T>
T time_shield::to_dt_ms ( ts_ms_t ts)
inline

Alias for to_date_time_ms function.

Converts a timestamp in milliseconds to a date-time structure with milliseconds.

Template Parameters
TThe type of the date-time structure to return.
Parameters
tsThe timestamp in milliseconds to convert.
Returns
T A date-time structure with the corresponding date and time components.

Definition at line 326 of file time_conversion_aliases.hpp.

◆ to_dt_ms() [3/3]

auto time_shield::to_dt_ms ( ts_ms_t ts_ms) -> decltype(to_date_time_ms<DateTimeStruct>(ts_ms))
inline

Alias for to_date_time_ms function.

Converts a timestamp in milliseconds to a date-time structure with milliseconds.

Template Parameters
TThe type of the date-time structure to return.
Parameters
tsThe timestamp in milliseconds to convert.
Returns
T A date-time structure with the corresponding date and time components.

Definition at line 341 of file time_conversion_aliases.hpp.

◆ to_dt_struct()

template<class T1, class T2 = ts_t>
T1 time_shield::to_dt_struct ( T2 ts)

Alias for to_date_time function.

Converts a timestamp to a date-time structure.

This function converts a timestamp (usually an integer representing seconds since epoch) to a custom date-time structure. The default type for the timestamp is int64_t.

Template Parameters
T1The date-time structure type to be returned.
T2The type of the timestamp (default is int64_t).
Parameters
tsThe timestamp to be converted.
Returns
A date-time structure of type T1.

Definition at line 308 of file time_conversion_aliases.hpp.

◆ to_dt_struct_ms()

template<class T>
T time_shield::to_dt_struct_ms ( ts_ms_t ts)
inline

Alias for to_date_time_ms function.

Converts a timestamp in milliseconds to a date-time structure with milliseconds.

Template Parameters
TThe type of the date-time structure to return.
Parameters
tsThe timestamp in milliseconds to convert.
Returns
T A date-time structure with the corresponding date and time components.

Definition at line 334 of file time_conversion_aliases.hpp.

◆ to_ftimestamp() [1/4]

double time_shield::to_ftimestamp ( const DateTimeStruct & dt)

Alias for dt_to_ftimestamp.

Convert a DateTimeStruct to floating-point timestamp.

Parameters
dtStructure with date and time fields.
Returns
Floating-point timestamp.

Definition at line 435 of file time_conversions.mqh.

◆ to_ftimestamp() [2/4]

double time_shield::to_ftimestamp ( const MqlDateTime & dt)

Alias for dt_to_ftimestamp.

Convert an MqlDateTime structure to floating-point timestamp.

Parameters
dtStandard MqlDateTime structure.
Returns
Floating-point timestamp.

Definition at line 439 of file time_conversions.mqh.

◆ to_ftimestamp() [3/4]

TIME_SHIELD_CONSTEXPR fts_t time_shield::to_ftimestamp ( const std::tm * timeinfo)
inline

Alias for tm_to_ftimestamp.

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).

Parameters
timeinfoPointer to the std::tm structure containing the date and time.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1523 of file time_conversion_aliases.hpp.

◆ to_ftimestamp() [4/4]

template<class T>
fts_t time_shield::to_ftimestamp ( const T & date_time)
constexpr

Alias for dt_to_ftimestamp.

Converts a date-time structure to a floating-point timestamp.

This function converts a given date and time structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1481 of file time_conversion_aliases.hpp.

◆ to_fts() [1/3]

TIME_SHIELD_CONSTEXPR fts_t time_shield::to_fts ( const std::tm * timeinfo)
inline

Alias for tm_to_ftimestamp.

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).

Parameters
timeinfoPointer to the std::tm structure containing the date and time.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1538 of file time_conversion_aliases.hpp.

◆ to_fts() [2/3]

template<class T>
fts_t time_shield::to_fts ( const T & date_time)
constexpr

Alias for dt_to_ftimestamp.

Converts a date-time structure to a floating-point timestamp.

This function converts a given date and time structure to a floating-point timestamp, which is the number of seconds (with fractional milliseconds) since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1498 of file time_conversion_aliases.hpp.

◆ to_fts() [3/3]

template<class T1 = year_t, class T2 = int, class T3 = int>
fts_t time_shield::to_fts ( T1 year,
T2 month,
T2 day,
T2 hour = 0,
T2 min = 0,
T2 sec = 0,
T3 ms = 0 )
constexpr

Alias for to_ftimestamp.

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).

Template Parameters
T1The type of the year parameter (default is year_t).
T2The type of the month, day, hour, minute, and second parameters (default is int).
T3The type of the millisecond parameter (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value (default is 0).
minThe minute value (default is 0).
secThe second value (default is 0).
msThe millisecond value (default is 0).
Returns
Floating-point timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_ftimestamp

Definition at line 1423 of file time_conversion_aliases.hpp.

◆ to_iso_week_date() [1/3]

IsoWeekDateStruct time_shield::to_iso_week_date ( const DateStruct & date)
inline

Convert DateStruct to ISO week date.

Parameters
dateDateStruct instance.
Returns
ISO week date representation.

Definition at line 74 of file iso_week_conversions.hpp.

◆ to_iso_week_date() [2/3]

template<class T = ts_t>
IsoWeekDateStruct time_shield::to_iso_week_date ( T ts)
inline

Convert timestamp to ISO week date.

Template Parameters
TTimestamp type.
Parameters
tsTimestamp in seconds.
Returns
ISO week date representation.

Definition at line 83 of file iso_week_conversions.hpp.

◆ to_iso_week_date() [3/3]

template<class Y = year_t, class M = Month, class D = int>
IsoWeekDateStruct time_shield::to_iso_week_date ( Y year,
M month,
D day )
inline

Convert calendar date to ISO week date.

Parameters
yearYear component.
monthMonth component.
dayDay component.
Returns
ISO week date representation.

Definition at line 55 of file iso_week_conversions.hpp.

◆ to_mql_dt()

MqlDateTime time_shield::to_mql_dt ( long ts)

Alias for to_date_time_mql.

Convert a timestamp to the standard MqlDateTime structure.

Parameters
tsTimestamp in seconds since UNIX epoch.
Returns
Filled MqlDateTime structure.

Definition at line 303 of file time_conversions.mqh.

◆ to_time_zone() [1/2]

TimeZoneStruct time_shield::to_time_zone ( int offset)

Convert an integer offset to a TimeZoneStruct.

Parameters
offsetOffset in seconds.
Returns
TimeZoneStruct represented by the offset.

Definition at line 1535 of file time_conversions.mqh.

◆ to_time_zone() [2/2]

template<class T = TimeZoneStruct>
T time_shield::to_time_zone ( tz_t offset)
inline

Converts an integer to a time zone structure.

Template Parameters
TThe type of the time zone structure (default is TimeZoneStruct).
Parameters
offsetThe integer to convert.
Returns
A time zone structure of type T represented by the given integer.

The function assumes that the type T has members hour, min, and is_positive.

Definition at line 25 of file time_zone_offset_conversions.hpp.

◆ to_timestamp() [1/5]

long time_shield::to_timestamp ( const DateTimeStruct & dt)

Alias for dt_to_timestamp.

Convert a DateTimeStruct to timestamp.

Parameters
dtStructure with date and time fields.
Returns
Timestamp in seconds.

Definition at line 341 of file time_conversions.mqh.

◆ to_timestamp() [2/5]

long time_shield::to_timestamp ( const MqlDateTime & dt)

Alias for dt_to_timestamp taking MqlDateTime.

Convert an MqlDateTime structure to timestamp.

Parameters
dtStandard MqlDateTime structure.
Returns
Timestamp in seconds.

Definition at line 345 of file time_conversions.mqh.

◆ to_timestamp() [3/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 836 of file time_conversion_aliases.hpp.

◆ to_timestamp() [4/5]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp ( const T & date_time)
inline

Alias for dt_to_timestamp function.

Converts a date-time structure 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).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 764 of file time_conversion_aliases.hpp.

◆ to_timestamp() [5/5]

long time_shield::to_timestamp ( long year,
int mon,
int day,
int hour = 0,
int min = 0,
int sec = 0 )

Convert date and time values to a timestamp.

Parameters
yearYear value.
monMonth value.
dayDay value.
hourHour value.
minMinute value.
secSecond value.
Returns
Timestamp in seconds.

Definition at line 355 of file time_conversions.mqh.

◆ to_timestamp_ms() [1/5]

long time_shield::to_timestamp_ms ( const DateTimeStruct & dt)

Alias for dt_to_timestamp_ms.

Convert a DateTimeStruct to a timestamp in milliseconds.

Parameters
dtStructure with date and time fields.
Returns
Timestamp in milliseconds.

Definition at line 413 of file time_conversions.mqh.

◆ to_timestamp_ms() [2/5]

long time_shield::to_timestamp_ms ( const MqlDateTime & dt)

Alias for dt_to_timestamp_ms.

Convert an MqlDateTime structure to a timestamp in milliseconds.

Parameters
dtStandard MqlDateTime structure.
Returns
Timestamp in milliseconds.

Definition at line 417 of file time_conversions.mqh.

◆ to_timestamp_ms() [3/5]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp_ms ( const std::tm * timeinfo)
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).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp in milliseconds representing the given date and time.

Definition at line 1368 of file time_conversion_aliases.hpp.

◆ to_timestamp_ms() [4/5]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_timestamp_ms ( const T & date_time)
inline

Alias for dt_to_timestamp_ms function.

Converts a date-time structure to a timestamp in milliseconds.

This function converts a given date and time structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1323 of file time_conversion_aliases.hpp.

◆ to_timestamp_ms() [5/5]

long time_shield::to_timestamp_ms ( long year,
int mon,
int day,
int hour = 0,
int min = 0,
int sec = 0,
int ms = 0 )

Convert date and time values to a timestamp in milliseconds.

Parameters
yearYear value.
monMonth value.
dayDay value.
hourHour value.
minMinute value.
secSecond value.
msMillisecond value.
Returns
Timestamp in milliseconds.

Definition at line 381 of file time_conversions.mqh.

◆ to_ts() [1/7]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 824 of file time_conversion_aliases.hpp.

◆ to_ts() [2/7]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts ( const T & date_time)
inline

Alias for dt_to_timestamp function.

Converts a date-time structure 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).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 773 of file time_conversion_aliases.hpp.

◆ to_ts() [3/7]

long time_shield::to_ts ( long year,
int mon,
int day,
int hour = 0,
int min = 0,
int sec = 0 )

Alias for to_timestamp with explicit date fields.

Convert date and time values to a timestamp.

Parameters
yearYear value.
monMonth value.
dayDay value.
hourHour value.
minMinute value.
secSecond value.
Returns
Timestamp in seconds.

Definition at line 368 of file time_conversions.mqh.

◆ to_ts() [4/7]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts ( year_t year,
int month,
int day )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 691 of file time_conversion_aliases.hpp.

◆ to_ts() [5/7]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 711 of file time_conversion_aliases.hpp.

◆ to_ts() [6/7]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 732 of file time_conversion_aliases.hpp.

◆ to_ts() [7/7]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 754 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [1/8]

TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts_ms ( const std::tm * timeinfo)
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).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp in milliseconds representing the given date and time.

Definition at line 1382 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [2/8]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::to_ts_ms ( const T & date_time)
inline

Alias for dt_to_timestamp_ms function.

Converts a date-time structure to a timestamp in milliseconds.

This function converts a given date and time structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1341 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [3/8]

long time_shield::to_ts_ms ( long year,
int mon,
int day,
int hour = 0,
int min = 0,
int sec = 0,
int ms = 0 )

Alias for to_timestamp_ms.

Convert date and time values to a timestamp in milliseconds.

Parameters
yearYear value.
monMonth value.
dayDay value.
hourHour value.
minMinute value.
secSecond value.
msMillisecond value.
Returns
Timestamp in milliseconds.

Definition at line 387 of file time_conversions.mqh.

◆ to_ts_ms() [4/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms ( year_t year,
int month,
int day )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1235 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [5/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1253 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [6/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1272 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [7/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1292 of file time_conversion_aliases.hpp.

◆ to_ts_ms() [8/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::to_ts_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec,
int ms )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
msThe millisecond value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 1313 of file time_conversion_aliases.hpp.

◆ to_tz_offset()

template<class T>
TIME_SHIELD_CONSTEXPR tz_t time_shield::to_tz_offset ( const T & tz)
inlinenoexcept

Convert time zone struct to offset in seconds.

Expects fields: hour, min, is_positive.

Definition at line 41 of file time_zone_offset_conversions.hpp.

◆ to_tz_struct()

TimeZoneStruct time_shield::to_tz_struct ( int offset)

Alias for to_time_zone.

Converts an integer to a time zone structure.

Template Parameters
TThe type of the time zone structure (default is TimeZoneStruct).
Parameters
offsetThe integer to convert.
Returns
A time zone structure of type T represented by the given integer.

The function assumes that the type T has members hour, min, and is_positive.

Definition at line 1541 of file time_conversions.mqh.

◆ to_unix_min() [1/2]

long time_shield::to_unix_min ( long ts)

Alias for get_unix_min.

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 1503 of file time_conversions.mqh.

◆ to_unix_min() [2/2]

template<class T = int64_t>
T time_shield::to_unix_min ( ts_t ts = time_shield::ts())
constexpr

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 248 of file time_conversion_aliases.hpp.

◆ to_unix_year() [1/2]

long time_shield::to_unix_year ( long ts)

Alias for get_unix_year function.

Alias for years_since_epoch function.

Converts a UNIX timestamp to a year.

Template Parameters
TThe type of the year (default is year_t).
Parameters
tsUNIX timestamp.
Returns
T Year corresponding to the given timestamp.

Definition at line 235 of file time_conversions.mqh.

◆ to_unix_year() [2/2]

template<class T = year_t>
T time_shield::to_unix_year ( ts_t ts)
constexprnoexcept

Alias for years_since_epoch function.

Converts a UNIX timestamp to a year.

Template Parameters
TThe type of the year (default is year_t).
Parameters
tsUNIX timestamp.
Returns
T Year corresponding to the given timestamp.

Definition at line 30 of file time_conversion_aliases.hpp.

◆ to_year() [1/2]

long time_shield::to_year ( long ts)

Alias for get_year.

Alias for year_of function.

Get the year from the timestamp.

This function returns the year of the specified timestamp in seconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 250 of file time_conversions.mqh.

◆ to_year() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::to_year ( ts_t ts = time_shield::ts())
inline

Alias for year_of function.

Get the year from the timestamp.

This function returns the year of the specified timestamp in seconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 1598 of file time_conversion_aliases.hpp.

◆ to_year_ms() [1/2]

long time_shield::to_year_ms ( long ts_ms)

Alias for get_year_ms.

Alias for year_of_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.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
ts_msTimestamp in milliseconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 265 of file time_conversions.mqh.

◆ to_year_ms() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::to_year_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

Alias for year_of_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.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
ts_msTimestamp in milliseconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 1621 of file time_conversion_aliases.hpp.

◆ try_parse_iso_week_date() [1/2]

bool time_shield::try_parse_iso_week_date ( const char * input,
std::size_t length,
IsoWeekDateStruct & iso_date )
inlinenoexcept

Alias for parse_iso_week_date.

Parameters
inputPointer to character buffer (may be not null-terminated).
lengthLength of the buffer.
iso_dateOutput ISO week date structure.
Returns
True if parsing succeeded and produced a valid ISO week date; otherwise false.

Definition at line 242 of file iso_week_conversions.hpp.

◆ try_parse_iso_week_date() [2/2]

bool time_shield::try_parse_iso_week_date ( const std::string & input,
IsoWeekDateStruct & iso_date )
inlinenoexcept

Alias for parse_iso_week_date, std::string overload.

Parameters
inputInput string containing ISO week date.
iso_dateOutput ISO week date structure.
Returns
True if parsing succeeded and produced a valid ISO week date; otherwise false.

Definition at line 250 of file iso_week_conversions.hpp.

◆ ts() [1/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 800 of file time_conversion_aliases.hpp.

◆ ts() [2/6]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts ( const T & date_time)
inline

Alias for dt_to_timestamp function.

Converts a date-time structure 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).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 782 of file time_conversion_aliases.hpp.

◆ ts() [3/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts ( year_t year,
int month,
int day )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 363 of file time_conversion_aliases.hpp.

◆ ts() [4/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 383 of file time_conversion_aliases.hpp.

◆ ts() [5/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 404 of file time_conversion_aliases.hpp.

◆ ts() [6/6]

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_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).

If the day is ≥ 1970 and year ≤ 31, parameters are assumed to be in DD-MM-YYYY order and are automatically reordered.

Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp

Definition at line 426 of file time_conversion_aliases.hpp.

◆ ts_from_tm()

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts_from_tm ( const std::tm * timeinfo)
inline

Alias for tm_to_timestamp.

Converts a std::tm structure to a timestamp.

This function converts a given std::tm structure to a timestamp, which is the number of seconds since the Unix epoch (January 1, 1970).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp representing the given date and time.

Definition at line 830 of file time_conversion_aliases.hpp.

◆ ts_ms() [1/8]

TIME_SHIELD_CONSTEXPR ts_t time_shield::ts_ms ( const std::tm * timeinfo)
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).

Parameters
timeinfoPointer to a std::tm structure containing the date and time information.
Returns
Timestamp in milliseconds representing the given date and time.

Definition at line 1389 of file time_conversion_aliases.hpp.

◆ ts_ms() [2/8]

template<class T>
TIME_SHIELD_CONSTEXPR ts_t time_shield::ts_ms ( const T & date_time)
inline

Alias for dt_to_timestamp_ms function.

Converts a date-time structure to a timestamp in milliseconds.

This function converts a given date and time structure to a timestamp in milliseconds, which is the number of milliseconds since the Unix epoch (January 1, 1970).

Template Parameters
TThe type of the date-time structure.
Parameters
date_timeThe date-time structure containing year, month, day, hour, minute, second, and millisecond fields.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1350 of file time_conversion_aliases.hpp.

◆ ts_ms() [3/8]

long time_shield::ts_ms ( long year,
int mon,
int day,
int hour = 0,
int min = 0,
int sec = 0,
int ms = 0 )

Alias for to_timestamp_ms.

Convert date and time values to a timestamp in milliseconds.

Parameters
yearYear value.
monMonth value.
dayDay value.
hourHour value.
minMinute value.
secSecond value.
msMillisecond value.
Returns
Timestamp in milliseconds.

Definition at line 393 of file time_conversions.mqh.

◆ ts_ms() [4/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms ( year_t year,
int month,
int day )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 855 of file time_conversion_aliases.hpp.

◆ ts_ms() [5/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms ( year_t year,
int month,
int day,
int hour )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 873 of file time_conversion_aliases.hpp.

◆ ts_ms() [6/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms ( year_t year,
int month,
int day,
int hour,
int min )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 892 of file time_conversion_aliases.hpp.

◆ ts_ms() [7/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 912 of file time_conversion_aliases.hpp.

◆ ts_ms() [8/8]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::ts_ms ( year_t year,
int month,
int day,
int hour,
int min,
int sec,
int ms )
inline

Alias for to_timestamp_ms.

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).

Template Parameters
T1The type of the year parameter (default is int64_t).
T2The type of the other date and time parameters (default is int).
Parameters
yearThe year value.
monthThe month value.
dayThe day value.
hourThe hour value.
minThe minute value.
secThe second value.
msThe millisecond value.
Returns
Timestamp in milliseconds representing the given date and time.
Exceptions
std::invalid_argumentif the date-time combination is invalid.
See also
to_timestamp_ms

Definition at line 933 of file time_conversion_aliases.hpp.

◆ tz_offset()

template<class T>
TIME_SHIELD_CONSTEXPR tz_t time_shield::tz_offset ( const T & tz)
inlinenoexcept

Alias for to_tz_offset.

Convert time zone struct to offset in seconds.

Expects fields: hour, min, is_positive.

Definition at line 2167 of file time_conversion_aliases.hpp.

◆ tz_offset_hm()

TIME_SHIELD_CONSTEXPR tz_t time_shield::tz_offset_hm ( int hour,
int min = 0 )
inlinenoexcept

Build offset in seconds from hours/minutes.

Parameters
hourSigned hours (e.g. -3, +5).
minMinutes (0..59).

Definition at line 51 of file time_zone_offset_conversions.hpp.

◆ uday() [1/2]

long time_shield::uday ( long ts)

Alias for get_unix_day.

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 1347 of file time_conversions.mqh.

◆ uday() [2/2]

template<class T = uday_t>
T time_shield::uday ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 71 of file time_conversion_aliases.hpp.

◆ uday_ms() [1/2]

long time_shield::uday_ms ( long ts_ms)

Alias for get_unix_day_ms.

Get UNIX day from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Number of days since UNIX epoch.

Definition at line 1386 of file time_conversions.mqh.

◆ uday_ms() [2/2]

template<class T = uday_t>
T time_shield::uday_ms ( ts_ms_t t_ms = time_shield::ts_ms())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 112 of file time_conversion_aliases.hpp.

◆ uday_to_ts() [1/2]

long time_shield::uday_to_ts ( long uday)

Alias for unix_day_to_timestamp.

Convert UNIX day to timestamp in seconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day.

Definition at line 1405 of file time_conversions.mqh.

◆ uday_to_ts() [2/2]

template<class T = ts_t>
T time_shield::uday_to_ts ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts 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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the specified UNIX day.

Definition at line 142 of file time_conversion_aliases.hpp.

◆ uday_to_ts_ms() [1/2]

long time_shield::uday_to_ts_ms ( long uday)

Alias for unix_day_to_timestamp_ms.

Convert UNIX day to timestamp in milliseconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day in milliseconds.

Definition at line 1428 of file time_conversions.mqh.

◆ uday_to_ts_ms() [2/2]

template<class T = ts_t>
T time_shield::uday_to_ts_ms ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts_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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the specified UNIX day.

Definition at line 172 of file time_conversion_aliases.hpp.

◆ umin() [1/2]

long time_shield::umin ( long ts)

Alias for get_unix_min.

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 1507 of file time_conversions.mqh.

◆ umin() [2/2]

template<class T = int64_t>
T time_shield::umin ( ts_t ts = time_shield::ts())
constexpr

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 255 of file time_conversion_aliases.hpp.

◆ unix_day() [1/2]

long time_shield::unix_day ( long ts)

Alias for get_unix_day.

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 1335 of file time_conversions.mqh.

◆ unix_day() [2/2]

template<class T = uday_t>
T time_shield::unix_day ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 55 of file time_conversion_aliases.hpp.

◆ unix_day_ms() [1/2]

long time_shield::unix_day_ms ( long ts_ms)

Alias for get_unix_day_ms.

Get UNIX day from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Number of days since UNIX epoch.

Definition at line 1374 of file time_conversions.mqh.

◆ unix_day_ms() [2/2]

template<class T = uday_t>
T time_shield::unix_day_ms ( ts_ms_t t_ms = time_shield::ts_ms())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 96 of file time_conversion_aliases.hpp.

◆ unix_day_to_timestamp() [1/2]

long time_shield::unix_day_to_timestamp ( long uday)

Convert UNIX day to timestamp in seconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day.

Definition at line 1391 of file time_conversions.mqh.

◆ unix_day_to_timestamp() [2/2]

template<class T = ts_t>
T time_shield::unix_day_to_timestamp ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts 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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the specified UNIX day.

Definition at line 128 of file time_conversion_aliases.hpp.

◆ unix_day_to_timestamp_ms() [1/2]

long time_shield::unix_day_to_timestamp_ms ( long uday)

Convert UNIX day to timestamp in milliseconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day in milliseconds.

Definition at line 1414 of file time_conversions.mqh.

◆ unix_day_to_timestamp_ms() [2/2]

template<class T = ts_t>
T time_shield::unix_day_to_timestamp_ms ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts_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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the specified UNIX day.

Definition at line 158 of file time_conversion_aliases.hpp.

◆ unix_day_to_ts() [1/2]

long time_shield::unix_day_to_ts ( long uday)

Alias for unix_day_to_timestamp.

Convert UNIX day to timestamp in seconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day.

Definition at line 1397 of file time_conversions.mqh.

◆ unix_day_to_ts() [2/2]

template<class T = ts_t>
T time_shield::unix_day_to_ts ( uday_t unix_day)
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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the specified UNIX day.

Definition at line 129 of file unix_time_conversions.hpp.

◆ unix_day_to_ts_ms() [1/2]

long time_shield::unix_day_to_ts_ms ( long uday)

Alias for unix_day_to_timestamp_ms.

Convert UNIX day to timestamp in milliseconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day in milliseconds.

Definition at line 1420 of file time_conversions.mqh.

◆ unix_day_to_ts_ms() [2/2]

template<class T = ts_t>
T time_shield::unix_day_to_ts_ms ( uday_t unix_day)
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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the specified UNIX day.

Definition at line 142 of file unix_time_conversions.hpp.

◆ unix_min() [1/2]

long time_shield::unix_min ( long ts)

Alias for get_unix_min.

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 1499 of file time_conversions.mqh.

◆ unix_min() [2/2]

template<class T = int64_t>
T time_shield::unix_min ( ts_t ts = time_shield::ts())
constexpr

Alias for min_since_epoch function.

Get UNIX minute.

This function returns the number of minutes elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is int64_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of minutes since the UNIX epoch.

Definition at line 241 of file time_conversion_aliases.hpp.

◆ unix_year() [1/2]

long time_shield::unix_year ( long ts)

Alias for get_unix_year function.

Alias for years_since_epoch function.

Converts a UNIX timestamp to a year.

Template Parameters
TThe type of the year (default is year_t).
Parameters
tsUNIX timestamp.
Returns
T Year corresponding to the given timestamp.

Definition at line 231 of file time_conversions.mqh.

◆ unix_year() [2/2]

template<class T = year_t>
T time_shield::unix_year ( ts_t ts)
constexprnoexcept

Alias for years_since_epoch function.

Converts a UNIX timestamp to a year.

Template Parameters
TThe type of the year (default is year_t).
Parameters
tsUNIX timestamp.
Returns
T Year corresponding to the given timestamp.

Definition at line 23 of file time_conversion_aliases.hpp.

◆ unixday() [1/2]

long time_shield::unixday ( long ts)

Alias for get_unix_day.

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 1343 of file time_conversions.mqh.

◆ unixday() [2/2]

template<class T = uday_t>
T time_shield::unixday ( ts_t ts = time_shield::ts())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 63 of file time_conversion_aliases.hpp.

◆ unixday_ms() [1/2]

long time_shield::unixday_ms ( long ts_ms)

Alias for get_unix_day_ms.

Get UNIX day from milliseconds timestamp.

Parameters
ts_msTimestamp in milliseconds.
Returns
Number of days since UNIX epoch.

Definition at line 1382 of file time_conversions.mqh.

◆ unixday_ms() [2/2]

template<class T = uday_t>
T time_shield::unixday_ms ( ts_ms_t t_ms = time_shield::ts_ms())
constexprnoexcept

Alias for days_since_epoch function.

Get UNIX day.

This function returns the number of days elapsed since the UNIX epoch.

Template Parameters
TThe return type of the function (default is unixday_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Number of days since the UNIX epoch.

Definition at line 104 of file time_conversion_aliases.hpp.

◆ unixday_to_ts() [1/2]

long time_shield::unixday_to_ts ( long uday)

Alias for unix_day_to_timestamp.

Convert UNIX day to timestamp in seconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day.

Definition at line 1401 of file time_conversions.mqh.

◆ unixday_to_ts() [2/2]

template<class T = ts_t>
T time_shield::unixday_to_ts ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts 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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in seconds representing the beginning of the specified UNIX day.

Definition at line 135 of file time_conversion_aliases.hpp.

◆ unixday_to_ts_ms() [1/2]

long time_shield::unixday_to_ts_ms ( long uday)

Alias for unix_day_to_timestamp_ms.

Convert UNIX day to timestamp in milliseconds.

Parameters
udayUNIX day value.
Returns
Timestamp at start of the day in milliseconds.

Definition at line 1424 of file time_conversions.mqh.

◆ unixday_to_ts_ms() [2/2]

template<class T = ts_t>
T time_shield::unixday_to_ts_ms ( uday_t unix_day)
constexprnoexcept

Alias for unix_day_to_ts_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.

Template Parameters
TThe return type of the function (default is ts_t).
Parameters
unix_dayNumber of days since the UNIX epoch.
Returns
The timestamp in milliseconds representing the beginning of the specified UNIX day.

Definition at line 165 of file time_conversion_aliases.hpp.

◆ us_of_sec() [1/2]

int time_shield::us_of_sec ( double ts)

Get the microsecond part of a floating-point timestamp.

Parameters
tsTimestamp in seconds with fractional part.
Returns
Microseconds of the second.

Definition at line 46 of file time_conversions.mqh.

◆ us_of_sec() [2/2]

template<class T = int>
T time_shield::us_of_sec ( fts_t ts)
constexprnoexcept

Get the microsecond part of the second from a floating-point timestamp.

Template Parameters
TType of the returned value (default is int).
Parameters
tsTimestamp in floating-point seconds.
Returns
T Microsecond part of the second.

Definition at line 36 of file time_unit_conversions.hpp.

◆ valid_tz_offset()

TIME_SHIELD_CONSTEXPR bool time_shield::valid_tz_offset ( tz_t off)
inlinenoexcept

Alias for is_valid_tz_offset.

Check if a numeric offset is within supported bounds.

Conservative range: [-12:00, +14:00].

Definition at line 2179 of file time_conversion_aliases.hpp.

◆ wd()

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::wd ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1954 of file time_conversion_aliases.hpp.

◆ wd_ms()

template<class T = Weekday>
T time_shield::wd_ms ( ts_ms_t ts_ms)
constexpr

Alias for weekday_of_ts_ms function.

Get the weekday from a timestamp in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 2010 of file time_conversion_aliases.hpp.

◆ wd_ts()

template<class T = Weekday, class U, typename std::enable_if< std::is_integral< U >::value, int >::type = 0>
T time_shield::wd_ts ( U ts)
constexprnoexcept

Alias for weekday_of_ts.

Get the second of the week day from a timestamp.

Parameters
tsTimestamp.
Returns
Weekday (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1994 of file time_conversion_aliases.hpp.

◆ week_begin() [1/2]

long time_shield::week_begin ( long ts)

Alias for start_of_week.

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.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the beginning of the week.

Definition at line 1227 of file time_conversions.mqh.

◆ week_begin() [2/2]

ts_t time_shield::week_begin ( ts_t ts = time_shield::ts())
constexpr

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.

Parameters
tsTimestamp (default: current timestamp).
Returns
Returns the timestamp of the beginning of the week.

Definition at line 2108 of file time_conversion_aliases.hpp.

◆ weekday() [1/2]

template<class T1 = Weekday>
T1 time_shield::weekday ( year_t year,
int month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1867 of file time_conversion_aliases.hpp.

◆ weekday() [2/2]

template<class T1 = Weekday>
T1 time_shield::weekday ( year_t year,
Month month,
int day )
constexpr

Alias for day_of_week_date.

Get the day of the week.

Template Parameters
T1Return type (default: Weekday).
T2Year type.
T3Month type.
T4Day type.
Parameters
yearYear.
monthMonth.
dayDay.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1874 of file time_conversion_aliases.hpp.

◆ weekday_from_date()

template<class T1 = Weekday, class T2>
TIME_SHIELD_CONSTEXPR T1 time_shield::weekday_from_date ( const T2 & date)
inline

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 101 of file date_conversions.hpp.

◆ weekday_of()

template<class T1 = Weekday, class T2, typename std::enable_if< std::is_class< T2 >::value, int >::type = 0>
T1 time_shield::weekday_of ( const T2 & date)
constexpr

Alias for weekday_of_date.

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 1922 of file time_conversion_aliases.hpp.

◆ weekday_of_date()

template<class T1 = Weekday, class T2>
TIME_SHIELD_CONSTEXPR T1 time_shield::weekday_of_date ( const T2 & date)
inline

Get the day of the week from a date structure.

This function takes a date structure with fields 'year', 'mon', and 'day', and returns the day of the week (SUN = 0, MON = 1, ... SAT = 6).

Parameters
dateStructure containing year, month, and day.
Returns
Day of the week (SUN = 0, MON = 1, ... SAT = 6).

Definition at line 93 of file date_conversions.hpp.

◆ workday() [1/2]

TIME_SHIELD_CONSTEXPR bool time_shield::workday ( ts_t ts)
inlinenoexcept

Alias for is_workday(ts_t).

Check if a given timestamp corresponds to a workday (Monday to Friday).

Parameters
tsTimestamp to check.
Returns
true if the day is a workday, false otherwise.

Definition at line 2148 of file time_conversion_aliases.hpp.

◆ workday() [2/2]

TIME_SHIELD_CONSTEXPR bool time_shield::workday ( year_t year,
int month,
int day )
inlinenoexcept

Alias for is_workday(year_t, int, int).

Check if a calendar date corresponds to a workday (Monday to Friday).

Parameters
yearYear component of the date.
monthMonth component of the date.
dayDay component of the date.
Returns
true if the date is valid and a workday, false otherwise.

Definition at line 2160 of file time_conversion_aliases.hpp.

◆ workday_index_in_month() [1/2]

int time_shield::workday_index_in_month ( long year,
int month,
int day )

Definition at line 997 of file time_conversions.mqh.

◆ workday_index_in_month() [2/2]

TIME_SHIELD_CONSTEXPR int time_shield::workday_index_in_month ( year_t year,
int month,
int day )
inlinenoexcept

Returns workday position in month starting from 1.

Parameters
yearTarget year.
monthTarget month (1-12).
dayDay of month (1-based).

Definition at line 73 of file workday_conversions.hpp.

◆ workday_ms()

TIME_SHIELD_CONSTEXPR bool time_shield::workday_ms ( ts_ms_t ts_ms)
inlinenoexcept

Alias for is_workday(ts_ms_t).

Check if a given timestamp corresponds to a workday (Monday to Friday).

Parameters
tsTimestamp to check.
Returns
true if the day is a workday, false otherwise.

Definition at line 2154 of file time_conversion_aliases.hpp.

◆ year() [1/2]

long time_shield::year ( long ts)

Alias for get_year.

Alias for year_of function.

Get the year from the timestamp.

This function returns the year of the specified timestamp in seconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 246 of file time_conversions.mqh.

◆ year() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year ( ts_t ts = time_shield::ts())
inline

Alias for year_of function.

Get the year from the timestamp.

This function returns the year of the specified timestamp in seconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 1591 of file time_conversion_aliases.hpp.

◆ year_begin() [1/2]

long time_shield::year_begin ( long ts)

Alias for start_of_year.

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.

Parameters
tsTimestamp.
Returns
Start of the year timestamp.

Definition at line 660 of file time_conversions.mqh.

◆ year_begin() [2/2]

TIME_SHIELD_CONSTEXPR ts_t time_shield::year_begin ( ts_t ts = time_shield::ts())
inline

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.

Parameters
tsTimestamp.
Returns
Start of the year timestamp.

Definition at line 1642 of file time_conversion_aliases.hpp.

◆ year_begin_date() [1/2]

long time_shield::year_begin_date ( long year)

Alias for start_of_year_date.

Get the timestamp of the start of the year.

Parameters
yearYear.
Returns
Timestamp at 00:00:00 of the first day of the year.

Definition at line 704 of file time_conversions.mqh.

◆ year_begin_date() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR ts_t time_shield::year_begin_date ( T year)
inline

Alias for start_of_year_date function.

Get the timestamp of the start of the year.

Parameters
yearYear.
Returns
Timestamp at 00:00:00 of the first day of the year.

Definition at line 1672 of file time_conversion_aliases.hpp.

◆ year_begin_date_ms() [1/2]

long time_shield::year_begin_date_ms ( long year)

Alias for start_of_year_date_ms.

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.

Parameters
yearYear.
Returns
Timestamp of the start of the year in milliseconds.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 719 of file time_conversions.mqh.

◆ year_begin_date_ms() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::year_begin_date_ms ( T year)
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.

Parameters
yearYear.
Returns
Timestamp of the start of the year in milliseconds.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1688 of file time_conversion_aliases.hpp.

◆ year_begin_ms() [1/2]

long time_shield::year_begin_ms ( long ts_ms)

Alias for start_of_year_ms.

Get the timestamp at the start of the year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the first day of the year.

Definition at line 675 of file time_conversions.mqh.

◆ year_begin_ms() [2/2]

ts_ms_t time_shield::year_begin_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

Alias for start_of_year_ms function.

Get the timestamp at the start of the year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the first day of the year.

Definition at line 1656 of file time_conversion_aliases.hpp.

◆ year_end()

TIME_SHIELD_CONSTEXPR ts_t time_shield::year_end ( ts_t ts = time_shield::ts())
inline

Alias for end_of_year function.

Get the end-of-year timestamp.

This function finds the last timestamp of the current year.

Parameters
tsTimestamp.
Returns
End-of-year timestamp.

Definition at line 1696 of file time_conversion_aliases.hpp.

◆ year_end_ms() [1/2]

long time_shield::year_end_ms ( long ts_ms)

Alias for end_of_year_ms.

Get the timestamp in milliseconds of the end of the year.

This function finds the last timestamp of the current year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
End-of-year timestamp in milliseconds.

Definition at line 730 of file time_conversions.mqh.

◆ year_end_ms() [2/2]

TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::year_end_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

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.

Parameters
ts_msTimestamp in milliseconds.
Returns
End-of-year timestamp in milliseconds.

Definition at line 1704 of file time_conversion_aliases.hpp.

◆ year_ms() [1/2]

long time_shield::year_ms ( long ts_ms)

Alias for get_year_ms.

Alias for year_of_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.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
ts_msTimestamp in milliseconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 261 of file time_conversions.mqh.

◆ year_ms() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

Alias for year_of_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.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
ts_msTimestamp in milliseconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 1614 of file time_conversion_aliases.hpp.

◆ year_of()

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year_of ( ts_t ts = time_shield::ts())
inline

Get the year from the timestamp.

This function returns the year of the specified timestamp in seconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
tsTimestamp in seconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 28 of file date_conversions.hpp.

◆ year_of_ms()

template<class T = year_t>
TIME_SHIELD_CONSTEXPR T time_shield::year_of_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

Get the year from the timestamp in milliseconds.

This function returns the year of the specified timestamp in milliseconds since the Unix epoch.

Template Parameters
TThe return type of the function (default is year_t).
Parameters
ts_msTimestamp in milliseconds (default is current timestamp).
Returns
Year of the specified timestamp.

Definition at line 40 of file date_conversions.hpp.

◆ year_start() [1/2]

long time_shield::year_start ( long ts)

Alias for start_of_year.

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.

Parameters
tsTimestamp.
Returns
Start of the year timestamp.

Definition at line 656 of file time_conversions.mqh.

◆ year_start() [2/2]

TIME_SHIELD_CONSTEXPR ts_t time_shield::year_start ( ts_t ts = time_shield::ts())
inline

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.

Parameters
tsTimestamp.
Returns
Start of the year timestamp.

Definition at line 1636 of file time_conversion_aliases.hpp.

◆ year_start_date() [1/2]

long time_shield::year_start_date ( long year)

Alias for start_of_year_date.

Get the timestamp of the start of the year.

Parameters
yearYear.
Returns
Timestamp at 00:00:00 of the first day of the year.

Definition at line 700 of file time_conversions.mqh.

◆ year_start_date() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR ts_t time_shield::year_start_date ( T year)
inline

Alias for start_of_year_date function.

Get the timestamp of the start of the year.

Parameters
yearYear.
Returns
Timestamp at 00:00:00 of the first day of the year.

Definition at line 1665 of file time_conversion_aliases.hpp.

◆ year_start_date_ms() [1/2]

long time_shield::year_start_date_ms ( long year)

Alias for start_of_year_date_ms.

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.

Parameters
yearYear.
Returns
Timestamp of the start of the year in milliseconds.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 715 of file time_conversions.mqh.

◆ year_start_date_ms() [2/2]

template<class T = year_t>
TIME_SHIELD_CONSTEXPR ts_ms_t time_shield::year_start_date_ms ( T year)
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.

Parameters
yearYear.
Returns
Timestamp of the start of the year in milliseconds.
Exceptions
std::invalid_argumentif the date-time combination is invalid.

Definition at line 1681 of file time_conversion_aliases.hpp.

◆ year_start_ms() [1/2]

long time_shield::year_start_ms ( long ts_ms)

Alias for start_of_year_ms.

Get the timestamp at the start of the year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the first day of the year.

Definition at line 671 of file time_conversions.mqh.

◆ year_start_ms() [2/2]

ts_ms_t time_shield::year_start_ms ( ts_ms_t ts_ms = time_shield::ts_ms())
inline

Alias for start_of_year_ms function.

Get the timestamp at the start of the year in milliseconds.

Parameters
ts_msTimestamp in milliseconds.
Returns
Timestamp at 00:00:00.000 of the first day of the year.

Definition at line 1650 of file time_conversion_aliases.hpp.

◆ years_since_epoch()

template<class T = year_t>
T time_shield::years_since_epoch ( ts_t ts)
constexprnoexcept

Converts a UNIX timestamp to a year.

Template Parameters
TThe type of the year (default is year_t).
Parameters
tsUNIX timestamp.
Returns
T Year corresponding to the given timestamp.

Definition at line 25 of file unix_time_conversions.hpp.