| 12345678910111213141516171819202122232425262728293031323334 |
- #ifndef DATETIME_H
- #define DATETIME_H
- #include "date.h"
- #include "tz.h"
- #include <chrono>
- #include <string>
- namespace DateTime {
- struct DateTime
- {
- DateTime(int year, unsigned month, unsigned day) : year(year), month(month), day(day) {}
- int year;
- unsigned month;
- unsigned day;
- int hour = 0;
- int min = 0;
- int sec = 0;
- };
- std::chrono::system_clock::time_point DateTime_UTC_to_time_point(const DateTime& dt);
- std::chrono::system_clock::time_point DateTime_to_time_point(const DateTime& dt, const date::time_zone* tzone);
- int GetTimestamp();
- int GetUTCOffset();
- std::string GetTimeString();
- std::string GetTimeString(const std::chrono::system_clock::time_point& timePoint);
- } // namespace DateTime
- #endif // DATETIME_H
|