php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47835 strtotime or date works wrong
Submitted: 2009-03-30 04:00 UTC Modified: 2009-03-30 07:20 UTC
From: snowyurik at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
 [2009-03-30 04:00 UTC] snowyurik at gmail dot com
Description:
------------
echo date('Y-m-d H:i:s',strtotime('2009-02-30 00:00:00'));

this code return
"2009-03-02 00:00:00" instead of "2009-02-30 00:00:00"

Reproduce code:
---------------
echo date('Y-m-d H:i:s',strtotime('2009-02-30 00:00:00'));

Expected result:
----------------
2009-02-30 00:00:00


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-30 07:20 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

This is also expected behavior, remember that there is no February 30th!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 19:01:30 2024 UTC