Page 1 of 1

date change year bug

Posted: Thu Dec 31, 2009 5:18 am
by klevis miho
This code:

Code: Select all

<?php
for($i=0; $i<7; $i++) {
    //should print today and 6 days after
    echo date("o-m-d", mktime() + $i * 86400);
    echo '<br />';
}
?>
Prints:

Code: Select all

2009-12-31
2009-01-01
2009-01-02
2009-01-03
2010-01-04
2010-01-05
2010-01-06

Is this a bug?

Re: date change year bug

Posted: Thu Dec 31, 2009 5:46 am
by manojsemwal1
hun if u use 'y' replace of 'o' it would be correct format..

Re: date change year bug

Posted: Thu Dec 31, 2009 5:49 am
by klevis miho
You are right thnx.
I posted this as a bug at php.net :$