# HG changeset patch # User Nathan Walp # Date 1051818016 0 # Node ID 36523a0d8459136451463bcfbb0df0a19c3e8f93 # Parent 1dcdc2504849a1a327cd52c14efea7d067bba140 [gaim-migrate @ 5651] iso8601 tweaks for jabber committer: Tailor Script diff -r 1dcdc2504849 -r 36523a0d8459 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Thu May 01 19:34:30 2003 +0000 +++ b/src/protocols/jabber/jabber.c Thu May 01 19:40:16 2003 +0000 @@ -1234,9 +1234,10 @@ struct tm t; time_t retval = 0; localtime_r(NULL, &t); - - if(sscanf(timestamp, "%04d%02d%02dT%02d:%02d:%02d", - &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec)) + char tz[6] = ""; + + if(sscanf(timestamp, "%04d%02d%02dT%02d:%02d:%02d%5s", + &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec, tz)) { t.tm_year -= 1900; t.tm_mon -= 1; @@ -1249,6 +1250,16 @@ retval -= timezone; # endif # endif + + if(tz[0] == '+' || tz[0] == '-') { + int hr, min; + if(sscanf(tz+1, "%2d%2d", &hr, &min)) { + if(tz[0] == '+') + retval -= (hr*60 + min)*60; + else + retval += (hr*60 + min)*60; + } + } } return retval;