Bug #53643 [Opn->Bgs]: the date('o-m-d',mktime()) displays current year incorrectly
| From: | derick@php.net | Date: | Mon, 03 Jan 2011 23:02:18 +0000 |
| Subject: | Bug #53643 [Opn->Bgs]: the date('o-m-d',mktime()) displays current year incorrectly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157529@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53643&edit=1
ID: 53643
Updated by: derick@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