#define _XOPEN_SOURCE
#include <stdio.h>
#include <time.h>
#include <string.h>
....
struct tm time1,time2;
memset(&time1,0x0,sizeof(struct tm));
memset(&time2,0x0,sizeof(struct tm));
strptime((*requesttokens)[i][5]->str,"%Y-%m-%d %H:%M:%S",&time1);
strptime((*requesttokens)[i][5]->str,"%Y-%m-%d %H:%M:%S",&time2);
printf("compared time: %ld %ld\n",(long)mktime(&time1),(long)mktime(&time2)); |