|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34052 [PATCH] date('U') returns %ld not unix timestamp
Submitted: 2005-08-09 18:10 UTC Modified: 2005-09-15 21:11 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: ash at theleys dot net Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5CVS-2005-09-03 OS: win32 only
Private report: No CVE-ID: None
 [2005-08-09 18:10 UTC] ash at theleys dot net
date('U') returns %ld not unix timestamp

Straight CGI (Fast CGI), ini set by installer, unchanged otherwise, worked under 5.04

Reproduce code:
echo date('U');

Expected result:
Unix timestamp, not, what looks like, an uninterpreted sprintf

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-04 14:52 UTC]
Please try using this CVS snapshot:
For Windows:

Please try the snapshot then.
 [2005-09-04 19:01 UTC] ash at theleys dot net
Hi, have tried snapshot. Still same. date('u') on PHP 4.3 still works (on another server) on IIS6 (so Windows Server 2003).
Thanks for looking in to this, Alan
 [2005-09-04 19:58 UTC]
Bah, forget my last post.
As timelib_sll is defined as __int64, we should use printf(%I64d) on windows.
 [2005-09-04 20:04 UTC]
We (should) use PHP's internal printing routines, this has nothing to do with the platform. It works fine here.
 [2005-09-04 22:10 UTC]
OK, now I see you are using PHP's sprintf implementation.
The problem is there. It only accepts  %lld if SIZEOF_LONG_LONG is true. However, config.w32.h defines it as 0, so %lld is disabled on windows.
 [2005-09-04 23:42 UTC]
Derick brakes, Derick fixes. :)

 [2005-09-04 23:42 UTC]

 [2005-09-05 08:06 UTC]
Don't assign things to me which I can't test. This is a bug in the port to Windows.
 [2005-09-05 08:58 UTC]
Derick, you got to be kidding? I know you have a windows machine to test with at work, so TEST it..

 [2005-09-05 12:06 UTC]
I couldn't test this patch because I haven't installed MSVC yet, but I think it should work.
 [2005-09-15 20:55 UTC]
Finally I've installed Microsoft Visual Studio .Net!
I've tested the patch and it works fine.
 [2005-09-15 21:11 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Fixed in PHP 5.1 and PHP 6.0.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:25 2019 UTC