comparison src/c/urweb.c @ 1439:6ff10428de4a

Fix 'readUtc' to work during DST
author Adam Chlipala <adam@chlipala.net>
date Fri, 18 Mar 2011 21:01:10 -0400
parents 4a6f84092399
children 0fc7b676b88b
comparison
equal deleted inserted replaced
1438:b6df00ed536c 1439:6ff10428de4a
3734 stm.tm_hour -= timezone / (60 * 60); 3734 stm.tm_hour -= timezone / (60 * 60);
3735 3735
3736 r->seconds = mktime(&stm); 3736 r->seconds = mktime(&stm);
3737 r->microseconds = 0; 3737 r->microseconds = 0;
3738 3738
3739 localtime_r(&r->seconds, &stm);
3740 if (stm.tm_isdst == 1) {
3741 ++stm.tm_hour;
3742 r->seconds = mktime(&stm);
3743 }
3744
3739 return r; 3745 return r;
3740 } 3746 }
3741 else 3747 else
3742 return NULL; 3748 return NULL;
3743 } 3749 }