php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49283 date('Y') display error
Submitted: 2009-08-18 05:42 UTC Modified: 2009-08-18 08:46 UTC
From: ht0315 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.10 OS: Solaris 10 sparc
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: ht0315 at gmail dot com
New email:
PHP Version: OS:

 

 [2009-08-18 05:42 UTC] ht0315 at gmail dot com
Description:
------------
date('Y') display error, print: 0000

Reproduce code:
---------------
<?php
echo date('y-m-d H:i:s');
echo date('Y-m-d H:i:s');
echo date('ymd');
echo date('Y');
echo date('y');
echo time();
echo date('Y-m-d', time());
echo date('y-m-d', time());
?>

Expected result:
----------------
09-08-18 13:18:36
2009-08-18 13:18:36
090818
2009
09
1250572716
2009-08-18
09-08-18

Actual result:
--------------
09-08-18 13:18:13
0000-08-18 13:18:13
090818
0000
09
1250572693
0000-08-18
09-08-18

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-18 07:17 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can not reproduce this. date('Y') outputs 2009 for me.
 [2009-08-18 08:46 UTC] scottmac@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.

Duplicate of bug #48276

It's fixed in SVN already and only affects big endian machines.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 31 02:00:03 2025 UTC