summaryrefslogtreecommitdiff
path: root/zen/time.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-09-01 00:24:17 +0000
committerB Stack <bgstack15@gmail.com>2020-09-01 00:24:17 +0000
commit5a3f52b016581a6a0cb4513614b6c620d365dde2 (patch)
treeacfdfb3e1046db87040477033fda0df76d92916a /zen/time.h
parentMerge branch '11.0' into 'master' (diff)
parentadd upstream 11.1 (diff)
downloadFreeFileSync-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.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/zen/time.h b/zen/time.h
index d3aef36f..aaf36983 100644
--- a/zen/time.h
+++ b/zen/time.h
@@ -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)
{
bgstack15