aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/time.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-08-04 12:50:23 +0000
committerlloyd <[email protected]>2010-08-04 12:50:23 +0000
commite19f1554004830e99872c13b8d5fa678b93d586a (patch)
tree51ebc37d2bda7ee4ad9d16f8e0408ac9dd844dd2 /src/utils/time.cpp
parent5d9eecf1646facfff9b20e9932894fce0d0ff39c (diff)
parent49ebca0d092bcb6a208604f7ac8d1b798f5170fc (diff)
propagate from branch 'net.randombit.botan' (head 717a9d103aa80e6d66c04e3a23cf173aadf56ceb)
to branch 'net.randombit.botan.c++0x' (head c9759e8ebc2f360696a11f2d00fc218d7a8bf744)
Diffstat (limited to 'src/utils/time.cpp')
-rw-r--r--src/utils/time.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/utils/time.cpp b/src/utils/time.cpp
index 65e808c04..d5b74828b 100644
--- a/src/utils/time.cpp
+++ b/src/utils/time.cpp
@@ -47,7 +47,7 @@ u64bit combine_timers(u32bit seconds, u32bit parts, u32bit parts_hz)
return res;
}
-std::tm do_gmtime(time_t time_val)
+std::tm do_gmtime(std::time_t time_val)
{
std::tm tm;
@@ -68,19 +68,12 @@ std::tm do_gmtime(time_t time_val)
}
/*
-* Get the system clock
-*/
-u64bit system_time()
- {
- return static_cast<u64bit>(std::time(0));
- }
-
-/*
* Convert a time_point to a calendar_point
*/
-calendar_point calendar_value(u64bit a_time_t)
+calendar_point calendar_value(
+ const std::chrono::system_clock::time_point& time_point)
{
- std::tm tm = do_gmtime(static_cast<std::time_t>(a_time_t));
+ std::tm tm = do_gmtime(std::chrono::system_clock::to_time_t(time_point));
return calendar_point(tm.tm_year + 1900,
tm.tm_mon + 1,