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

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

$
0
0

Here is a wired solution in c/pseudo code I just hacked together. Good luck!

char * runner = NULL;char *string_orig = "YYYY-MM-DD HH:MM:SS";time_t time = 0;struct tm tmp;use strstr(string_orig, "-") and atoi foreach  tmp->tm_year ..   tmp->tm_mon  ..   tmp->tm_mday ..    tmp->tm_hour  ..   tmp->tm_min  ..   tmp->tm_sec .. with *runner as helptime = mktime(&tm)

Viewing all articles
Browse latest Browse all 8

Trending Articles