3#ifndef _TIME_SHIELD_TIME_ZONE_CONVERSIONS_HPP_INCLUDED
4#define _TIME_SHIELD_TIME_ZONE_CONVERSIONS_HPP_INCLUDED
24 const int OLD_START_SUMMER_HOUR = 2;
25 const int OLD_STOP_SUMMER_HOUR = 3;
26 const int NEW_SUMMER_HOUR = 1;
33 for(
int d = max_days; d >= dt.
day; --d) {
36 if(dt.
hour >= OLD_START_SUMMER_HOUR)
45 for(
int d = max_days; d >= dt.
day; --d) {
48 if(dt.
hour >= OLD_STOP_SUMMER_HOUR)
63 for(
int d = max_days; d >= dt.
day; --d) {
66 if(dt.
hour >= (NEW_SUMMER_HOUR + 2))
76 for(
int d = max_days; d >= dt.
day; --d) {
79 if(dt.
hour >= (NEW_SUMMER_HOUR + 1))
103 const int SWITCH_HOUR = 1;
107 }
else if(dt.
mon ==
MAR) {
111 }
else if(dt.
day < last) {
114 if(dt.
hour >= SWITCH_HOUR)
118 }
else if(dt.
mon ==
OCT) {
122 }
else if(dt.
day < last) {
125 if(dt.
hour >= SWITCH_HOUR)
Header for date and time structure and related functions.
constexpr int64_t SEC_PER_HOUR
Seconds per hour.
ts_t eet_to_gmt(ts_t eet)
Convert Eastern European Time to Greenwich Mean Time.
ts_t gmt_to_eet(ts_t gmt)
Convert Greenwich Mean Time to Eastern European Time.
ts_t cet_to_gmt(ts_t cet)
Convert Central European Time to Greenwich Mean Time.
ts_t gmt_to_cet(ts_t gmt)
Convert Greenwich Mean Time to Central European Time.
TIME_SHIELD_CONSTEXPR T1 last_sunday_month_day(T2 year, T3 month)
Get the day of the last Sunday of the given month and year.
constexpr T1 num_days_in_month(ts_t ts=time_shield::ts()) noexcept
Alias for num_days_in_month_ts function.
T1 to_date_time(T2 ts)
Converts a timestamp to a date-time structure.
constexpr T1 day_of_week_date(T2 year, T3 month, T4 day)
Get the day of the week.
int64_t ts_t
Unix timestamp in seconds since 1970‑01‑01T00:00:00Z.
Main namespace for the Time Shield library.
Structure to represent date and time.
int hour
Hour component of time (0-23)
int64_t year
Year component of the date.
int day
Day component of the date (1-31).
int mon
Month component of the date (1-12).
Header file for time conversion functions.