cvs: php4 /ext/standard/ datetime.c
| From: | Andrei Zmievski | Date: | Fri, 09 Jun 2000 20:18:36 +0000 |
| Subject: | cvs: php4 /ext/standard/ datetime.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127@lists.php.net to get a copy of this message | ||
andrei Fri Jun 9 13:18:36 2000 EDT
Modified files:
/php4/ext/standard datetime.c
Log:
@- Fixed 'Z' flag in date() to adjust for daylight savings time. (Andrei)
Index: php4/ext/standard/datetime.c
diff -u php4/ext/standard/datetime.c:1.42 php4/ext/standard/datetime.c:1.43
--- php4/ext/standard/datetime.c:1.42 Mon Jun 5 12:47:44 2000
+++ php4/ext/standard/datetime.c Fri Jun 9 13:18:36 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: datetime.c,v 1.42 2000/06/05 19:47:44 andi Exp $ */
+/* $Id: datetime.c,v 1.43 2000/06/09 20:18:36 andrei Exp $ */
#include "php.h"
@@ -54,6 +54,7 @@
#if !defined(HAVE_TM_ZONE) && !defined(_TIMEZONE) &&
!defined(HAVE_DECLARED_TIMEZONE)
extern time_t timezone;
+extern int daylight;
#endif
static int phpday_tab[2][12] =
@@ -404,9 +405,9 @@
break;
case 'Z': /* timezone offset in seconds */
#if HAVE_TM_GMTOFF
- sprintf(tmp_buff, "%ld", ta->tm_gmtoff );
+ sprintf(tmp_buff, "%ld", ta->tm_isdst ? ta->tm_gmtoff-3600 : ta->tm_gmtoff);
#else
- sprintf(tmp_buff, "%ld", timezone);
+ sprintf(tmp_buff, "%ld", daylight ? timezone-3600 : timezone);
#endif
strcat(return_value->value.str.val, tmp_buff);
break;