On May 5, 2013, at 1:09 PM, Anders Dalvander
Sorry about that, should be:
chrono::date d = year(2013) / may / day(5); chrono::time t = hours(12) + minutes(34) + seconds(56); chrono::date_time dt(d, t); // Here `dt` should be the representation of May 5th 2013 at 12:34:56, but that in turn occurred at different instants for different people around the world. // In order to convert it to a `chono::system_clock::time_point` a timezone would be needed: chono::system_clock::time_point instant = dt.in_timezone(chrono::timezones::utc); // or perhaps `dt.in_utc()` for short.
Fwiw, I just ran this program fragment: day_point d = year(2013) / may / day(5); auto t = hours(13) + minutes(34) + seconds(30); auto dt = d + t; auto EDT = hours(-4); dt -= EDT; auto dt_now = system_clock::now(); auto diff = dt_now - dt; std::cout << duration_cast<seconds>(diff).count() << " seconds\n"; And it output: 1 seconds Howard