diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-10-17 16:56:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-17 16:56:21 +0300 |
commit | 0ef7a9b39cf72da1211039ab22bdf8f9f6a2c984 (patch) | |
tree | 6f51ef179497265b5bff2a355471ae5dc9643ad2 /indra/llcommon/lldate.h | |
parent | 9e24b300d02e5627ea0d304d412cb683ec2de3a4 (diff) | |
parent | d3d349ae0f17a72481f30b9354b9367b1cd3b639 (diff) |
Merge pull request #2856 from secondlife/marchcat/c-develop
Develop → Maint C sync
Diffstat (limited to 'indra/llcommon/lldate.h')
-rw-r--r-- | indra/llcommon/lldate.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index 67dfa1b5d1..534b660689 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -43,16 +43,15 @@ */ class LL_COMMON_API LLDate { + static constexpr F64 DATE_EPOCH = 0.0; public: - /** - * @brief Construct a date equal to epoch. - */ - LLDate(); + using timestamp = F64; /** - * @brief Construct a date equal to the source date. + * @brief Construct a date equal to epoch. */ - LLDate(const LLDate& date); + constexpr LLDate() : mSecondsSinceEpoch(DATE_EPOCH) + {} /** * @brief Construct a date from a seconds since epoch value. @@ -104,14 +103,14 @@ public: * * @return The number of seconds since epoch UTC. */ - F64 secondsSinceEpoch() const; + timestamp secondsSinceEpoch() const; /** * @brief Set the date in seconds since epoch. * * @param seconds The number of seconds since epoch UTC. */ - void secondsSinceEpoch(F64 seconds); + void secondsSinceEpoch(timestamp seconds); /** * @brief Create an LLDate object set to the current time. @@ -148,7 +147,7 @@ public: private: - F64 mSecondsSinceEpoch; + timestamp mSecondsSinceEpoch; }; // Helper function to stream out a date |