php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46995 gmdate("l") returns "Saturday" (correct) but gmdate("w")=6 (Sunday, incorrect)
Submitted: 2009-01-03 01:08 UTC Modified: 2009-01-03 01:50 UTC
From: DePhille at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.8 OS: Linux CentOS
Private report: No CVE-ID: None
 [2009-01-03 01:08 UTC] DePhille at gmail dot com
Description:
------------
The gmdate("w") function returns a wrong value.

Reproduce code:
---------------
<?php
$mytime=1230944636;       // Sat, 03 Jan 2009 01:03:56 GMT
echo gmdate("l");         // This returns "Saturday" (correct)
echo gmdate("w");         // This returns 6 (incorrect, 6 would mean Sunday!
?>

Expected result:
----------------
the gmdate("w") function returns an incorrect value.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-03 01:50 UTC] scottmac@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

From the manual page:

Numeric representation of the day of the week
0 (for Sunday) through 6 (for Saturday)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 10:00:03 2025 UTC