php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53686 mktime(0,0,0, 12,32, 2010) means 2011 1 1 , is it reasonable?
Submitted: 2011-01-07 09:30 UTC Modified: 2011-01-07 09:38 UTC
From: huarong at masalife dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.17 OS: centos5
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: huarong at masalife dot com
New email:
PHP Version: OS:

 

 [2011-01-07 09:30 UTC] huarong at masalife dot com
Description:
------------
---
From manual page: http://www.php.net/function.mktime#Notes
---

mktime(0,0,0, 12,32, 2010) means 2011 1 1  , is this reasonable?

why not check the date first?




Test script:
---------------
print mktime(0,0,0, 12,32, 2010) - mktime(0,0,0, 12,31, 2010);


//86400


Expected result:
----------------
return false .


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-07 09:38 UTC] aharvey@php.net
-Status: Open +Status: Bogus -Package: Unknown/Other Function +Package: Date/time related
 [2011-01-07 09:38 UTC] aharvey@php.net
That's how mktime() works. If you want to check the validity of a date,
use checkdate().
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 18 14:00:02 2025 UTC