21 #include "synchronization.h" 26 BEGIN_NAMESPACE_SYNCHRONIZATION
44 UTCTime(int32_t hours, int32_t minutes,
double seconds, int32_t day, int32_t month, int32_t year) noexcept;
55 UTCTime(int64_t unixTime,
double secondsFraction) noexcept;
65 explicit UTCTime(
double dateTime) noexcept;
143 int32_t hours, minutes, seconds;
144 double secondsFraction;
145 int32_t day, month, year;
150 void calculateUnixAndDateTime(
const std::time_t& time);
151 static std::time_t TmToTimeT(std::tm& tm);
152 static std::tm TimeTToTm(std::time_t& time);
153 void setTime(std::time_t& time);
156 END_NAMESPACE_SYNCHRONIZATION
static constexpr double DateTimeAtUnixStart
UTC days since 30-Dec-1899 UTC, fractional part represents ratio of day.
Definition: utc_time.h:140
int32_t getYear() const
Years of Common Era [1970, INF)
int32_t getSeconds() const
Seconds of minute with fractional part [0, 59].
UTCTime(int32_t hours, int32_t minutes, double seconds, int32_t day, int32_t month, int32_t year) noexcept
Constructs UTCTime from human readable time and date, parameters over their limits are handled and co...
static double RelativeSecondsBetween(const UTCTime &start, const UTCTime &end)
Calculates relative seconds between two UTC times.
static UTCTime IncrementSeconds(const UTCTime &time, double secondsIncrement)
Increments UTC time by positive or negative amount of seconds, the maximum size of an increment is eq...
double getDateTimeValue() const
UTC days since 30-Dec-1899 UTC, fractional part represents ratio of day.
int32_t getDay() const
Day of month [1, 31].
double getSecondsFraction() const
Fractional part of a second [0.0, 1.0)
int64_t getUnixTimeValue() const
Integer number of seconds since start of Unix time on 01-Jan-1970 UTC.
int32_t getMonth() const
Month of year [1, 12].
int32_t getMinutes() const
Minutes of hour [0, 59].
Definition: utc_time.h:28
int32_t getHours() const
Hours of day [0, 23].