| 67 | } |
| 68 | |
| 69 | DateTime::DateTime() |
| 70 | { |
| 71 | auto now = std::chrono::system_clock::now(); |
| 72 | auto now_time_t = std::chrono::system_clock::to_time_t(now); |
| 73 | |
| 74 | std::stringstream ss; |
| 75 | ss << std::put_time(std::localtime(&now_time_t), "%F"); |
| 76 | date = ss.str(); |
| 77 | |
| 78 | ss.str(""); |
| 79 | ss << std::put_time(std::localtime(&now_time_t), "%T"); |
| 80 | time = ss.str(); |
| 81 | |
| 82 | ss.str(""); |
| 83 | ss << std::put_time(std::localtime(&now_time_t), "%z"); |
| 84 | timezone = ss.str(); |
| 85 | } |
| 86 | |
| 87 | } // namespace DevPosture |