diff options
Diffstat (limited to 'src/utils/time.h')
-rw-r--r-- | src/utils/time.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/utils/time.h b/src/utils/time.h index c7f459096..bd1c8fb06 100644 --- a/src/utils/time.h +++ b/src/utils/time.h @@ -9,16 +9,32 @@ #define BOTAN_TIME_H__ #include <botan/types.h> -#include <ctime> +#include <chrono> namespace Botan { /* -* Time Access/Conversion Functions +* Time Conversion Functions */ -BOTAN_DLL u64bit system_time(); +struct BOTAN_DLL calendar_point + { + u32bit year; + byte month; + byte day; + byte hour; + byte minutes; + byte seconds; + + calendar_point(u32bit y, byte mon, byte d, byte h, byte min, byte sec) : + year(y), month(mon), day(d), hour(h), minutes(min), seconds(sec) {} + }; -BOTAN_DLL std::tm time_t_to_tm(u64bit); +/* +* @param time_point a time point from the system clock +* @returns calendar_point object representing this time point +*/ +BOTAN_DLL calendar_point calendar_value( + const std::chrono::system_clock::time_point& time_point); /** @return nanoseconds resolution timestamp, unknown epoch |