diff options
author | B Stack <bgstack15@gmail.com> | 2020-09-01 00:24:17 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-09-01 00:24:17 +0000 |
commit | 5a3f52b016581a6a0cb4513614b6c620d365dde2 (patch) | |
tree | acfdfb3e1046db87040477033fda0df76d92916a /zen/time.h | |
parent | Merge branch '11.0' into 'master' (diff) | |
parent | add upstream 11.1 (diff) | |
download | FreeFileSync-5a3f52b016581a6a0cb4513614b6c620d365dde2.tar.gz FreeFileSync-5a3f52b016581a6a0cb4513614b6c620d365dde2.tar.bz2 FreeFileSync-5a3f52b016581a6a0cb4513614b6c620d365dde2.zip |
Merge branch '11.1' into 'master'11.1
add upstream 11.1
See merge request opensource-tracking/FreeFileSync!25
Diffstat (limited to 'zen/time.h')
-rw-r--r-- | zen/time.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -21,12 +21,9 @@ struct TimeComp //replaces std::tm and SYSTEMTIME int hour = 0; //0-23 int minute = 0; //0-59 int second = 0; //0-60 (including leap second) + + bool operator==(const TimeComp&) const = default; }; -inline bool operator==(const TimeComp& lhs, const TimeComp& rhs) -{ - return lhs.second == rhs.second && lhs.minute == rhs.minute && lhs.hour == rhs.hour && lhs.day == rhs.day && lhs.month == rhs.month && lhs.year == rhs.year; -} -inline bool operator!=(const TimeComp& lhs, const TimeComp& rhs) { return !(lhs == rhs); } TimeComp getLocalTime(time_t utc = std::time(nullptr)); //convert time_t (UTC) to local time components, returns TimeComp() on error time_t localToTimeT(const TimeComp& tc); //convert local time components to time_t (UTC), returns -1 on error @@ -199,6 +196,8 @@ TimeComp getCompileTime() } + + inline Zstring formatTime(const Zchar* format, const TimeComp& tc) { |