Akumuli
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
datetime.h
1 
17 #pragma once
18 
19 #include "akumuli.h"
20 #include "akumuli_def.h"
21 
22 #define BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
23 #include <boost/date_time/posix_time/posix_time.hpp>
24 
25 #include <chrono>
26 
27 namespace Akumuli {
28 
29 using aku_Duration = aku_Timestamp;
30 
36 struct BadDateTimeFormat;
38 
40 struct DateTimeUtil {
41 
42  static aku_Timestamp from_std_chrono(std::chrono::system_clock::time_point timestamp);
43 
44  static aku_Timestamp from_boost_ptime(boost::posix_time::ptime timestamp);
45 
46  static boost::posix_time::ptime to_boost_ptime(aku_Timestamp timestamp);
47 
53  static aku_Timestamp from_iso_string(const char* iso_str);
54 
57  static int to_iso_string(aku_Timestamp ts, char* buffer, size_t buffer_size);
58 
62  static aku_Duration parse_duration(const char* str, size_t size);
63 };
64 }
static aku_Timestamp from_iso_string(const char *iso_str)
Definition: datetime.cpp:64
static int to_iso_string(aku_Timestamp ts, char *buffer, size_t buffer_size)
Definition: datetime.cpp:132
static aku_Duration parse_duration(const char *str, size_t size)
Definition: datetime.cpp:155
Static utility class for date-time utility functions.
Definition: datetime.h:40