cvs: php4 /ext/standard datetime.c

From: Date: Thu, 15 Jun 2000 22:23:08 +0000
Subject: cvs: php4 /ext/standard datetime.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-295@lists.php.net to get a copy of this message
andrei Thu Jun 15 15:23:08 2000 EDT Modified files: /php4/ext/standard datetime.c Log: Use hardcoded 3600 seconds offset instead of altzone which may not be present on all systems. Index: php4/ext/standard/datetime.c diff -u php4/ext/standard/datetime.c:1.47 php4/ext/standard/datetime.c:1.48 --- php4/ext/standard/datetime.c:1.47 Thu Jun 15 09:24:10 2000 +++ php4/ext/standard/datetime.c Thu Jun 15 15:23:08 2000 @@ -19,7 +19,7 @@ */ -/* $Id: datetime.c,v 1.47 2000/06/15 16:24:10 andrei Exp $ */ +/* $Id: datetime.c,v 1.48 2000/06/15 22:23:08 andrei Exp $ */ #include "php.h" @@ -53,7 +53,7 @@ }; #if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) && !defined(HAVE_DECLARED_TIMEZONE) -extern time_t timezone, altzone; +extern time_t timezone; extern int daylight; #endif @@ -169,11 +169,10 @@ #else /* ** If correcting for daylight savings time, we set the adjustment to - ** the value of altzone variable. Otherwise, we need to overcorrect and - ** set the adjustment to the main timezone offset plus difference - ** between the main and alternate ones. + ** the value of timezone - 3600 seconds. Otherwise, we need to overcorrect and + ** set the adjustment to the main timezone + 3600 seconds. */ - gmadjust = -(is_dst ? altzone : timezone + (timezone - altzone)); + gmadjust = -(is_dst ? timezone - 3600 : timezone + 3600); #endif seconds += gmadjust; } @@ -411,7 +410,7 @@ #if HAVE_TM_GMTOFF sprintf(tmp_buff, "%ld", ta->tm_gmtoff); #else - sprintf(tmp_buff, "%ld", ta->tm_isdst ? altzone : timezone); + sprintf(tmp_buff, "%ld", ta->tm_isdst ? timezone - 3600 : timezone); #endif strcat(return_value->value.str.val, tmp_buff); break;

« previous php.cvs (#295) next »