HowardHinnant / date

A date and time library based on the C++11/14/17 <chrono> header
Other
3.07k stars 669 forks source link

Transform date::local_seconds and timezone offset to struct tm #819

Closed iFuSiiOnzZ closed 3 months ago

iFuSiiOnzZ commented 3 months ago

Hi,

I was looking at the documentation but there seems to be no conversion between the date::local_senconds and C data structure tm. Using std::localtime(local_time.time_since_epoch().count()) is not working properly. Any suggestions on how to achieve it?

Thank you!

HowardHinnant commented 3 months ago

Here's a brief article on interfacing with the C API: https://github.com/HowardHinnant/date/wiki/Examples-and-Recipes#Ccompatiblity