Created
December 18, 2013 12:07
-
-
Save kinnou02/8021247 to your computer and use it in GitHub Desktop.
"Sun Dec 09 2012" to date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <time.h> | |
main(){ | |
char* date = "Sun Dec 09 2012"; | |
struct tm tm = {0, 0, 0, 0, 0, 0, 0 ,0, 0}; | |
strptime(date, "%a %b %d %Y", &tm); | |
time_t t = mktime(&tm); | |
printf("%d", t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment