Skip to content

Instantly share code, notes, and snippets.

@kinnou02
Created December 18, 2013 12:07
Show Gist options
  • Save kinnou02/8021247 to your computer and use it in GitHub Desktop.
Save kinnou02/8021247 to your computer and use it in GitHub Desktop.
"Sun Dec 09 2012" to date
#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