Edit report at http://bugs.php.net/bug.php?id=53643&edit=1
ID: 53643 Updated by: der...@php.net Reported by: pranay dot pramod at gmail dot com Summary: the date('o-m-d',mktime()) displays current year incorrectly -Status: Open +Status: Bogus Type: Bug Package: Date/time related Operating System: windows XP SP2 PHP Version: 5.3.4 Block user comment: N Private report: N New Comment: 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 o is the ISO8601 year: http://en.wikipedia.org/wiki/ISO_week_date Y is the natural year. Previous Comments: ------------------------------------------------------------------------ [2011-01-03 17:47:55] pranay dot pramod at gmail dot com Description: ------------ <?php $today = getdate(); $firstDayOfCurrentMonth = date('o-m-d H:i:s', mktime(00, 00, 00, date("m"), 01 , $today['year'])); echo $firstDayOfCurrentMonth; ?> Test script: --------------- <?php $today = getdate(); $firstDayOfCurrentMonth = date('o-m-d H:i:s', mktime(00, 00, 00, date("m"), 01 , $today['year'])); echo $firstDayOfCurrentMonth; ?> Expected result: ---------------- expected output: 2011-01-01 00:00:00 Actual result: -------------- actual output: 2010-01-01 00:00:00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53643&edit=1