git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-06-13 02:48:49 +00:00
Родитель 9f32fd3e9a
Коммит 7aac416d2c
1 изменённых файлов: 7 добавлений и 5 удалений

12
time.c
Просмотреть файл

@ -272,7 +272,7 @@ static VALUE time_gmtime _((VALUE));
static VALUE time_localtime _((VALUE)); static VALUE time_localtime _((VALUE));
static VALUE time_get_tm _((VALUE, int)); static VALUE time_get_tm _((VALUE, int));
#if defined(HAVE_DAYLIGHT) && !defined __MINGW32__ #if defined(HAVE_DAYLIGHT) && !defined(__MINGW32__)
extern int daylight; extern int daylight;
extern long timezone; extern long timezone;
#endif #endif
@ -317,9 +317,9 @@ make_time_t(tptr, utc_or_local)
if (guess < 0) goto out_of_range; if (guess < 0) goto out_of_range;
if (!utc_or_local) { /* localtime zone adjust */ if (!utc_or_local) { /* localtime zone adjust */
#if defined(HAVE_DAYLIGHT) #if defined(HAVE_TM_ZONE)
localtime(&guess); tm = localtime(&guess);
guess += timezone + daylight; guess += tm->tm_gmtoff;
#else #else
struct tm gt, lt; struct tm gt, lt;
long tzsec; long tzsec;
@ -809,7 +809,9 @@ time_zone(time)
time_get_tm(time, tobj->gmt); time_get_tm(time, tobj->gmt);
} }
#if defined HAVE_TZNAME && defined HAVE_DAYLIGHT #if defined(HAVE_TM_ZONE)
return rb_str_new2(tobj->tm.tm_zone);
#elif defined(HAVE_TZNAME) && defined(HAVE_DAYLIGHT)
return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]); return rb_str_new2(tzname[daylight && tobj->tm.tm_isdst]);
#else #else
len = strftime(buf, 64, "%Z", &tobj->tm); len = strftime(buf, 64, "%Z", &tobj->tm);