From cab8224cc35dcc4647effb635dc5eff4a2324d83 Mon Sep 17 00:00:00 2001 From: Ivan Popivanov Date: Wed, 8 Oct 2014 01:51:06 -0400 Subject: [PATCH] Adding Timestamp::raw Returns the raw value, (the internal representation) of the timestamp. Useful when storing to a database for instance. --- Foundation/include/Poco/Timestamp.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Foundation/include/Poco/Timestamp.h b/Foundation/include/Poco/Timestamp.h index f8fa0683d..8cd440337 100644 --- a/Foundation/include/Poco/Timestamp.h +++ b/Foundation/include/Poco/Timestamp.h @@ -106,6 +106,9 @@ public: bool isElapsed(TimeDiff interval) const; /// Returns true iff the given interval has passed /// since the time denoted by the timestamp. + + TimeVal raw() const; + /// Returns the raw time value. static Timestamp fromEpochTime(std::time_t t); /// Creates a timestamp from a std::time_t. @@ -243,6 +246,11 @@ inline void swap(Timestamp& s1, Timestamp& s2) s1.swap(s2); } +inline Timestamp::TimeVal Timestamp::raw() const +{ + return _ts; +} + } // namespace Poco