Reputation: 3246
I have a time_t
variable containing a timestamp which I'd like to store in a database, so I need it as a string. How would I convert it?
Also, on the subject, how would I convert a timestamp string into a time_t
variable?
Thanks, Wyatt
Upvotes: 1
Views: 4095
Reputation: 181
Since it's tagged C++, I'd recommend this: istringstream
http://www.cplusplus.com/reference/iostream/istringstream/
Works like a charm. Might require ostringstream
as well.
Upvotes: 0