php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39740 gmdate("D") off by GMT offset
Submitted: 2006-12-05 04:05 UTC Modified: 2006-12-13 01:00 UTC
From: tessone at polyglut dot net Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 4.4.4 OS: Linux 2.4.21
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tessone at polyglut dot net
New email:
PHP Version: OS:

 

 [2006-12-05 04:05 UTC] tessone at polyglut dot net
Description:
------------
gmdate("D") and date("D") give different answers for the same date, with gmdate off from the correct day of the week. This seems to be a common bug across many applications -- google "gmdate off by one" and you'll see it has popped up in Drupal, Moodle, and other programs. I am seeing the bug pop up in RS Events plugin for Wordpress. Everywhere the problem seems to be gmdate().

Reproduce code:
---------------
print gmdate("D F jS",1165717800);
print date("D F jS",1165717800);

Expected result:
----------------
Sun December 10th
Sun December 10th

Actual result:
--------------
Sat December 10th
Sun December 10th

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-05 10:02 UTC] tony2001@php.net
Cannot reproduce both with PHP4 and PHP5.
 [2006-12-13 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 11:01:36 2025 UTC