Re: Time comparison in wap_push_ppg.c
"Wilfried Goesgens" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
i should have read the strptime manpage more acurate... and the timezone stuff is not yet accurate. but i think, this is the more apropriate way to go... cvs diff wap_push_ppg.c Index: wap_push_ppg.c =================================================================== RCS file: /home/cvs/gateway/gw/wap_push_ppg.c,v retrieving revision 1.64 diff -r1.64 wap_push_ppg.c 2735c2735,2739 < --- > struct tm aftertime; > time_t after_T; > time_t now_T; > char *error; > char *timestr=octstr_get_cstr(after); 2738c2742,2750 < --- > error=strptime(timestr,"%Y-%m-%dT%H:%M:%SZ",&aftertime); > if (error[0]=='0') > return 1; // the string wasn't parseable > after_T=mktime(&aftertime); > now_T=mktime(&now); > if (after_T<now_T) return 0; > else return 1; > > /* 2751,2752c2763,2764 < < return 0; --- > > return 0;*/