Closed Laureu closed 1 year ago
I found out myself I could use get_local_time() instead of get_sys_time(). It was obvious, sorry !
Again thanks for all the libs !
Hi Laureu,
Yes, .get_local_time()
is the answer. I also wanted to add that you can format that local time with date::format("%Y%m%d%H%M%S", tp)
to get the desired string. Though the way you deconstructed timepoint
into fields is also correct and is what date::format
is doing under the hood.
Thank you for the tip ! This will allow me to lighten my code
Hello Mr Howard Hinnant. Thank you for all your work on your timezones and date !
I have a zoned_time created from an UTC timestamp and a string timezone. How can I manage to print the YYYYMMDDHHSS format of the local place please ? I managed to get a string by using a code of you found on github, but I printed the utc informations. Here is what I tried:
I suppose my make_time usage from the zoned_time is wrong. What do you think about it ?
Thank you very much !