php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70394 Date value is not right.
Submitted: 2015-08-31 08:03 UTC Modified: 2015-08-31 08:15 UTC
From: xjiujiu at foxmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.4Git-2015-08-31 (Git) OS: Win10 64bit
Private report: No CVE-ID: None
 [2015-08-31 08:03 UTC] xjiujiu at foxmail dot com
Description:
------------
strtotime("2015-08-31 11:18:07") -> int(1440991087)
date(1440991087) -> string(19) "2015-08-31 11:08:07" 
strtotime('2015-08-31 11:08:07') -> int(1440990487)

Test script:
---------------
$time = strtotime("2015-08-31 11:18:07");
var_dump($time);
echo date('Y-m-d H:m:s', $time);
$sTime = strtotime('2015-08-31 11:08:07');
var_dump($sTime);
echo date('Y-m-d H:m:s', $sTime);

Expected result:
----------------
2015-08-31 11:08:07

Actual result:
--------------
2015-08-31 11:18:07

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-31 08:11 UTC] xjiujiu at foxmail dot com
My Mistake, The date format is wrong...Sorry~
 [2015-08-31 08:15 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2015-08-31 08:15 UTC] requinix@php.net
Yeah, 'm' is month and not minute.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 14:01:33 2024 UTC