php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62610 date('l, F m, Y') function outputs wrong date
Submitted: 2012-07-19 13:31 UTC Modified: 2012-07-20 15:08 UTC
From: jason at jasonbutz dot info Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.2-1ubuntu4.17 with Suhosin-Patch (cli) (built: Jun 19 2012 03:21:35) OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jason at jasonbutz dot info
New email:
PHP Version: OS:

 

 [2012-07-19 13:31 UTC] jason at jasonbutz dot info
Description:
------------
When I use the date function with the included arguments the date is always output 
as "Thursday, July 07, 2012" when using the default timestamp.

Test script:
---------------
<?php
echo "Today is ".date('m/d/Y')."\n";
echo date('l, F m, Y')."\n";
echo date('l, F m, Y', time())."\n";
echo date('l, F m, Y', strtotime("01/01/2012"));
?>

Expected result:
----------------
date('l, F m, Y') to show the current date, not Thursday, July 07, 2012


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-19 13:32 UTC] jason at jasonbutz dot info
-PHP Version: 5.3Git-2012-07-19 (Git) +PHP Version: 5.3.2-1ubuntu4.17 with Suhosin-Patch (cli) (built: Jun 19 2012 03:21:35)
 [2012-07-19 13:32 UTC] jason at jasonbutz dot info
Correcting PHP version
 [2012-07-20 01:25 UTC] aharvey@php.net
-Status: Open +Status: Feedback -Package: *General Issues +Package: Date/time related
 [2012-07-20 01:25 UTC] aharvey@php.net
I can't reproduce this at all on current versions of PHP 5.3 or 5.4. Is that really the output you're getting with that exact script?

Also, please see if you can replicate this without Suhosin on the current version of PHP 5.3; ie 5.3.15.

Pastebins of working code:

5.3: http://codepad.viper-7.com/DIzp07
5.4: http://codepad.viper-7.com/uXv3EY
 [2012-07-20 14:29 UTC] jason at jasonbutz dot info
aharvey:
Both your examples show the bug. The second and third dates both shows July 7, 
when it is not July 7.
 [2012-07-20 14:30 UTC] jason at jasonbutz dot info
Nevermind, I see what I did. Sorry.
 [2012-07-20 14:30 UTC] jason at jasonbutz dot info
-Status: Feedback +Status: Closed
 [2012-07-20 15:08 UTC] rasmus@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 09:01:32 2025 UTC