diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-12 14:46:44 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-12 14:46:44 +0000 |
commit | c86f2148a2ba7c8117403eda288f52e9e9431289 (patch) | |
tree | 2012557c6adbc4999be8b8ea30add250e51325b9 /time.c | |
parent | 548b5143db2c3d701520671ef1413cf3c39fcedf (diff) |
2000-06-12
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -272,6 +272,11 @@ static VALUE time_gmtime _((VALUE)); static VALUE time_localtime _((VALUE)); static VALUE time_get_tm _((VALUE, int)); +#if defined(HAVE_DAYLIGHT) && !defined __MINGW32__ +extern int daylight; +extern long timezone; +#endif + static time_t make_time_t(tptr, utc_or_local) struct tm *tptr; @@ -313,9 +318,6 @@ make_time_t(tptr, utc_or_local) if (!utc_or_local) { /* localtime zone adjust */ #if defined(HAVE_DAYLIGHT) - extern int daylight; - extern long timezone; - localtime(&guess); guess += timezone + daylight; #else @@ -807,8 +809,8 @@ time_zone(time) time_get_tm(time, tobj->gmt); } -#ifdef HAVE_TZNAME - return rb_str_new2(tobj->tm.tm_zone); +#if defined HAVE_TZNAME && defined HAVE_DAYLIGHT + return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]); #else len = strftime(buf, 64, "%Z", &tobj->tm); return rb_str_new(buf, len); |