Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Return the current local time in ISO 8601 format which includes
- // the offset from UTC.
- // i.e. 2019-09-27T13:51:30+01:00
- std::string timeISO()
- {
- auto now = std::chrono::system_clock::now();
- auto in_time_t = std::chrono::system_clock::to_time_t(now);
- std::tm tm = *std::localtime(&in_time_t);
- std::stringstream ss;
- ss << std::put_time(&tm, "%FT%T%z");
- return ss.str();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement