I need a local now point that will give me current time zone values. For instance if i am in Kansas, the local time would be the value of GMT-6. Using system_clock::now() i get UTC time.... see below:
1 2 3 4 5
std::chrono::local_seconds timestamp() {
auto now_point = std::chrono::system_clock::now();
auto r = std::chrono::local_time<std::chrono::seconds>(now_point);
auto point = std::chrono::time_point_cast<std::chrono::seconds>(now_point);
return point;
this obviously does not compile but how to get local_time???
The classes in <chrono> have no understanding of human times, they're designed just for timestamps and time deltas. A time_point just represents an absolute point in time, not the reading of a clock set to a particular timezone.