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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Sun Jun 02 06:01:28 2024 UTC