Quantcast
Channel: how to convert datetime to unix timestamp in c? - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by Kjetil Joergensen for how to convert datetime to unix timestamp in c?

$
0
0

You could try a combination of strptime and mktime

struct tm tm;time_t epoch;if ( strptime(timestamp, "%Y-%m-%d %H:%M:%S", &tm) != NULL )  epoch = mktime(&tm);else  // badness

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>