php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49116 strftime
Submitted: 2009-07-31 02:32 UTC Modified: 2009-07-31 07:55 UTC
From: undoluck at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2SVN-2009-07-31 (snap) OS: win server2003
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: undoluck at gmail dot com
New email:
PHP Version: OS:

 

 [2009-07-31 02:32 UTC] undoluck at gmail dot com
Description:
------------
strftime -- strtotime

Reproduce code:
---------------
---
From manual page: function.strftime
---
<?php
date_default_timezone_set('PRC');
$str1 = "07/31/2009 12:00:00 AM";
$t1 = strtotime($str1);
var_dump($t1);

echo "\nt1: ".strftime("%I:%M:%S %p", $t1);
echo "\nt1: ".strftime("%H:%M:%S", $t1);
echo "\n ".date('m/d/Y H:i:s', $t1);
?>



Expected result:
----------------
t1: 12:00:00 AM
t1: 12:00:00
 07/31/2009 12:00:00

Actual result:
--------------
int(1248969600)

t1: 12:00:00 AM
t1: 00:00:00
 07/31/2009 00:00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-31 07:55 UTC] jani@php.net
12am (which you should never use according to some docs :) is actually 00:00 in 24h clock. No bug here.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 28 20:00:02 2025 UTC