i have a core file for c++ code which shows the value of std::chrono::steady_clock::now() as follows in gdb:
__d = {__r = 783605893786420}
how do i convert it to UTC ?
i have a core file for c++ code which shows the value of std::chrono::steady_clock::now() as follows in gdb:
__d = {__r = 783605893786420}
how do i convert it to UTC ?
The units of steady_clock
on your platform is nanoseconds.
783605893786420ns is the amount of time since the steady_clock
epoch.
783605893786420ns is the same amount of time as 9 days, 1 hour, 40 minutes, and 5.893786420 seconds.
So for this clock, the epoch was 9 days, 1 hour, 40 minutes, and 5.893786420 seconds prior to when steady_clock::now()
was called.
The only way you can convert this to UTC is if you know the relationship between UTC and the time 9 days, 1 hour, 40 minutes, and 5.893786420 seconds prior to when this call was made. Most likely, this would be the last time your machine booted up. If by any chance you know what UTC time your machine was booted up, you can add 9 days, 1 hour, 40 minutes, and 5.893786420 seconds to that time to convert 783605893786420 to UTC.
In the future, if you want to discover UTC times, use system_clock
instead.