diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-22 08:29:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-22 08:29:58 +0000 |
commit | 623f789e46a571d4d18ba5a7ae5fd657e5d34a0f (patch) | |
tree | 10e665c60414c3070ce957e5c534e30ed499bc2d /time.c | |
parent | 2c4dd0158164639963d6957bb20a5606a807c5a6 (diff) | |
download | ruby-623f789e46a571d4d18ba5a7ae5fd657e5d34a0f.tar.gz ruby-623f789e46a571d4d18ba5a7ae5fd657e5d34a0f.tar.xz ruby-623f789e46a571d4d18ba5a7ae5fd657e5d34a0f.zip |
2000-06-22
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -316,6 +316,11 @@ make_time_t(tptr, utc_or_local) tm = localtime(&guess); if (!tm) goto error; guess -= tm->tm_gmtoff; + tm = localtime(&guess); + if (!tm) goto error; + if (tm->tm_hour != tptr->tm_hour) { + guess += (tptr->tm_hour - tm->tm_hour)*3600; + } #else struct tm gt, lt; long tzsec; @@ -338,18 +343,17 @@ make_time_t(tptr, utc_or_local) else { tzsec += (gt.tm_yday - lt.tm_yday)*24*3600; } - if (lt.tm_isdst) guess += 3600; guess += tzsec; if (guess < 0) { goto out_of_range; } -#endif tm = localtime(&guess); if (!tm) goto error; - if (tm->tm_hour != tptr->tm_hour) { + if (lt.tm_isdst != tm->tm_isdst) { guess -= 3600; } +#endif if (guess < 0) { goto out_of_range; } |