Bug #13885 Updated: gmdate("r"); adds timezone instead of 'GMT'.

From: Date: Wed, 31 Oct 2001 12:18:06 +0000
Subject: Bug #13885 Updated: gmdate("r"); adds timezone instead of 'GMT'.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-69415@lists.php.net to get a copy of this message
ID: 13885 Updated by: rasmus Reported By: root@mediamonks.net Status: Open Bug Type: Date/time related Operating System: Windows 2000 SP2 PHP Version: 4.0.6 New Comment: Ah, ok. Too early in the morning here. Looks like a Windows-specific issue as your test displays this on my Linux box: Wed, 31 Dec 1969 16:00:01 -0800 Thu, 1 Jan 1970 00:00:01 +0000 Previous Comments: ------------------------------------------------------------------------ [2001-10-31 07:11:04] root@mediamonks.net print(date("r", 1)); Prints: "Thu, 1 Jan 1970 01:00:01 +0100" This is correct, the local timezone is GMT+1. print(gmdate("r",1)); Prints: "Thu, 1 Jan 1970 00:00:01 +0100" This is wrong, it outputs the GMT date & time, but with the timezone "+0100" instead of "GMT". Thus equaling a date of "Wed, 31 Dec 1969 23:00:01 GMT", which is obviously not 1 second after the start of the unix epoch. ------------------------------------------------------------------------ [2001-10-31 07:00:49] rasmus@php.net I must be missing something here. date('r') is intended to display an RFC822 date string. Section 5.1 of RFC822 clearly states that +0100 is a perfectly valid way to represent the timezone. So how is this function not working as expected? ------------------------------------------------------------------------ [2001-10-31 06:45:57] root@mediamonks.net The 'r' format string doesn't work as expected: print(date("r", 1)); Prints: "Thu, 1 Jan 1970 01:00:01 +0100" print(gmdate("r",1)); Prints: "Thu, 1 Jan 1970 00:00:01 +0100" I think the '+0100' should've been 'GMT'. (Done on a system with GMT+1) ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13885&edit=1

« previous php.dev (#69415) next »