diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-03-21 15:45:20 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-03-21 15:46:37 +0900 |
commit | 733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /boost/date_time/posix_time | |
parent | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff) | |
download | boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2 boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip |
Imported Upstream version 1.58.0upstream/1.58.0
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/date_time/posix_time')
-rw-r--r-- | boost/date_time/posix_time/conversion.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/boost/date_time/posix_time/conversion.hpp b/boost/date_time/posix_time/conversion.hpp index 59e5cb7c12..ed3d4867e9 100644 --- a/boost/date_time/posix_time/conversion.hpp +++ b/boost/date_time/posix_time/conversion.hpp @@ -30,6 +30,14 @@ namespace posix_time { return start + seconds(static_cast<long>(t)); } + //! Function that converts a ptime into a time_t + inline + std::time_t to_time_t(ptime pt) + { + time_duration dur = pt - ptime(gregorian::date(1970,1,1)); + return std::time_t(dur.total_seconds()); + } + //! Convert a time to a tm structure truncating any fractional seconds inline std::tm to_tm(const boost::posix_time::ptime& t) { |