Mercurial > pidgin.yaz
comparison src/protocols/jabber/jabber.c @ 5112:463b03cd8c90
[gaim-migrate @ 5475]
don't ignore daylight savings time
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 11 Apr 2003 21:23:02 +0000 |
parents | 496ea7c1b77b |
children | 102135caa225 |
comparison
equal
deleted
inserted
replaced
5111:a262ecfd83bb | 5112:463b03cd8c90 |
---|---|
1230 | 1230 |
1231 static time_t iso8601_to_time(char *timestamp) | 1231 static time_t iso8601_to_time(char *timestamp) |
1232 { | 1232 { |
1233 struct tm t; | 1233 struct tm t; |
1234 time_t retval = 0; | 1234 time_t retval = 0; |
1235 localtime_r(NULL, &t); | |
1235 | 1236 |
1236 if(sscanf(timestamp, "%04d%02d%02dT%02d:%02d:%02d", | 1237 if(sscanf(timestamp, "%04d%02d%02dT%02d:%02d:%02d", |
1237 &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec)) | 1238 &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec)) |
1238 { | 1239 { |
1239 t.tm_year -= 1900; | 1240 t.tm_year -= 1900; |
1240 t.tm_mon -= 1; | 1241 t.tm_mon -= 1; |
1241 t.tm_isdst = 0; | |
1242 retval = mktime(&t); | 1242 retval = mktime(&t); |
1243 # ifdef HAVE_TM_GMTOFF | 1243 # ifdef HAVE_TM_GMTOFF |
1244 retval += t.tm_gmtoff; | 1244 retval += t.tm_gmtoff; |
1245 # else | 1245 # else |
1246 # ifdef HAVE_TIMEZONE | 1246 # ifdef HAVE_TIMEZONE |