php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50619 date change year
Submitted: 2009-12-31 11:26 UTC Modified: 2009-12-31 12:15 UTC
From: klevisi at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.12 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: klevisi at gmail dot com
New email:
PHP Version: OS:

 

 [2009-12-31 11:26 UTC] klevisi at gmail dot com
Description:
------------
When the year changes it displays not the expected results

Reproduce code:
---------------
<?php
for($i=0; $i<7; $i++) {
    echo date("o-m-d", mktime() + $i * 86400);
    echo '<br />';
}
?>

Expected result:
----------------
2009-12-31
2010-01-01
2010-01-02
2010-01-03
2010-01-04
2010-01-05
2010-01-06

Actual result:
--------------
2009-12-31
2009-01-01
2009-01-02
2009-01-03
2010-01-04
2010-01-05
2010-01-06

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-31 12:15 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The \"o\" specifier is for the \"ISO Year\", see http://en.wikipedia.org/wiki/ISO_year#Relation_with_the_Gregorian_calendar for what that means. You probably want to use \"Y\" instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 07:01:32 2024 UTC