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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: snowyurik at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Oct 31 23:01:28 2024 UTC