summaryrefslogtreecommitdiff
path: root/src/components/include/utils/date_time.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/include/utils/date_time.h')
-rw-r--r--src/components/include/utils/date_time.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/components/include/utils/date_time.h b/src/components/include/utils/date_time.h
index 158ae8dcdd..e584d50aa2 100644
--- a/src/components/include/utils/date_time.h
+++ b/src/components/include/utils/date_time.h
@@ -34,24 +34,24 @@
#if defined(OS_POSIX)
#include <sys/time.h>
-typedef struct timeval TimevalStruct;
+#elif defined(OS_WINDOWS)
+#include "utils/winhdr.h"
#endif
#include <stdint.h>
+typedef struct timeval TimevalStruct;
namespace date_time {
enum TimeCompare { LESS, EQUAL, GREATER };
+const uint64_t kDeltaEpochInMicrosecs = 11644473600000000u;
+const uint32_t kMillisecondsInSecond = 1000u;
+const uint32_t kMicrosecondsInMillisecond = 1000u;
+const uint32_t kMicrosecondsInSecond =
+ kMillisecondsInSecond * kMicrosecondsInMillisecond;
+
class DateTime {
public:
- static const int32_t MILLISECONDS_IN_SECOND = 1000;
- static const int32_t MICROSECONDS_IN_MILLISECOND = 1000;
- static const int32_t NANOSECONDS_IN_MICROSECOND = 1000;
- static const int32_t MICROSECONDS_IN_SECOND =
- MILLISECONDS_IN_SECOND * MICROSECONDS_IN_MILLISECOND;
- static const int32_t NANOSECONDS_IN_MILLISECOND =
- MICROSECONDS_IN_MILLISECOND * NANOSECONDS_IN_MICROSECOND;
-
static TimevalStruct getCurrentTime();
// return SECONDS count