aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/time.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-09 02:53:56 +0000
committerlloyd <[email protected]>2010-03-09 02:53:56 +0000
commitcdcd3a9aba28cefcccb64f91fb56d3847f6c9130 (patch)
tree6f4efd137aad848e698f9f4fc48a8bc9145fea12 /src/utils/time.cpp
parent4a9afbb99bb73e43bcb3a30379d6a2dd59dae76a (diff)
parent3c15bd259f0921f1fa08ec91ee3cf2621c64a02d (diff)
propagate from branch 'net.randombit.botan' (head 9932d4d63417f7fcc199ada244cbaa6c1c32d9c1)
to branch 'net.randombit.botan.c++0x' (head f4a385a376311edc62ef506c72cc56f69e6efd5a)
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 0dbbd5e9c..bc9aa8a2f 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;
@@ -67,20 +67,13 @@ 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,