• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

covert epoch to date string in c++?

SelArom

Senior member
hi, I've been up and down google trying to find a function that does this. I have an integer that has the time in epoch seconds, and I would like to convert it to a string representing the date and time. is there a library with this function built in or anything that might help me do this?

thank you!
-SelArom
 
Are you talking about unix time - ie. seconds since 1970-01-01 00:00:00 UTC? If so, then you want gmtime() or localtime() which will give you a struct tm result.
 
yes that's what I'm talking about, but the thing is localtime wants a const time_t and the value is stored as a string. how do I pass that to the localtime function?

thank you!

-SelArom
 
Back
Top