mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 19:25:53 +02:00
Adding Timestamp::raw
Returns the raw value, (the internal representation) of the timestamp. Useful when storing to a database for instance.
This commit is contained in:
@@ -106,6 +106,9 @@ public:
|
|||||||
bool isElapsed(TimeDiff interval) const;
|
bool isElapsed(TimeDiff interval) const;
|
||||||
/// Returns true iff the given interval has passed
|
/// Returns true iff the given interval has passed
|
||||||
/// since the time denoted by the timestamp.
|
/// since the time denoted by the timestamp.
|
||||||
|
|
||||||
|
TimeVal raw() const;
|
||||||
|
/// Returns the raw time value.
|
||||||
|
|
||||||
static Timestamp fromEpochTime(std::time_t t);
|
static Timestamp fromEpochTime(std::time_t t);
|
||||||
/// Creates a timestamp from a std::time_t.
|
/// Creates a timestamp from a std::time_t.
|
||||||
@@ -243,6 +246,11 @@ inline void swap(Timestamp& s1, Timestamp& s2)
|
|||||||
s1.swap(s2);
|
s1.swap(s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Timestamp::TimeVal Timestamp::raw() const
|
||||||
|
{
|
||||||
|
return _ts;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user