39{
40 char * c_time_string;
41 int i;
42 time_t now,now_utc,dummy_time;
43 double tdiff;
44 struct tm *tm_dum,*tm_now;
45 char datestring[32], curtime[32];
46
47 c_time_string = malloc(*time_string_len+1);
48 for (i=0;i<*time_string_len;i++) c_time_string[i]=time_string[i];
49 c_time_string[*time_string_len]='\0';
50
51
52
53 time( &now );
54 strftime(datestring, 32, "%Y-%m-%dT%H:%M:%S", gmtime( &now ));
55 tm_now = (struct tm*)malloc(sizeof (struct tm));
57 now_utc=mktime(tm_now);
58
59
60 tm_dum = malloc(sizeof (struct tm));
62 dummy_time= mktime(tm_dum);
63 tdiff=difftime(dummy_time,now_utc);
64
65 if (tdiff > 0 ){
66 * difference = 1;
67 }else{
68 * difference = -1;
69
70 }
71
72
73
74
75
76
77}
void strptime_impl(char *date, struct tm *tm)