php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53654 translate epoch time to wrong date time
Submitted: 2011-01-04 19:38 UTC Modified: 2011-01-04 19:43 UTC
From: benjaminlin1019 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3SVN-2011-01-04 (snap) OS: linux and mac
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: benjaminlin1019 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-01-04 19:38 UTC] benjaminlin1019 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.strftime#Description
---
$date = strftime("%G-%m-%d", 1293868800 );
print $date . "\n";
output: 2010-01-01 

it should be 2011-01-01

Expected result:
----------------
2011-01-01

Actual result:
--------------
2010-01-01

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-04 19:43 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2011-01-04 19:43 UTC] rasmus@php.net
You are confusing ISO-8601:1988 years and calendar years.  Jan 1, 2011 is actually 
in ISO-8601 year 2010.  You want %Y instead of %G here.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 22:01:34 2025 UTC