Mercurial > pidgin-twitter
changeset 120:b47bc7b89de6
a better way to keep time sane.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 18 Jul 2008 01:46:51 +0900 |
parents | 0c4a83f734cd |
children | 8b58990f5ee9 |
files | pidgin-twitter.c |
diffstat | 1 files changed, 2 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin-twitter.c Fri Jul 18 01:00:18 2008 +0900 +++ b/pidgin-twitter.c Fri Jul 18 01:46:51 2008 +0900 @@ -308,23 +308,11 @@ gchar *lc_time = setlocale(LC_TIME, NULL); setlocale(LC_TIME, "C"); - /* set timezone to UTC */ - gchar *timezone = g_strdup(getenv("TZ")); - setenv("TZ", "UTC", TRUE); - tzset(); - /* read time stamp */ struct tm res; strptime(str, "%a %b %d %T %z %Y", &res); - st->time = mktime(&res); - - /* restore timezone */ - if(timezone) - setenv("TZ", timezone, TRUE); - else - unsetenv("TZ"); - - g_free(timezone); + tzset(); + st->time = mktime(&res) - timezone; /* restore locale */ setlocale(LC_TIME, lc_time);