php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24929 date("G") returns nothing
Submitted: 2003-08-04 01:56 UTC Modified: 2003-08-04 10:55 UTC
From: sean at shrum dot net Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.3.2 OS: Linux
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: sean at shrum dot net
New email:
PHP Version: OS:

 

 [2003-08-04 01:56 UTC] sean at shrum dot net
Description:
------------
I get nothing back from the date("G") function call.  Granted, I am using a offset value with it but the offset works with every other date call so I know the offset value is not the cause



Reproduce code:
---------------
$offset = strtotime("+3 hours");
$time_vars["hour_24"] = date("G", $offset);


Expected result:
----------------
$time_vars["hour_24"] should have the current hour in 24-hour format without leading zeros. If it is 1 am, the result should be "4" (due to the offset).  If it is 5 pm, the result should be "22" (due to the offset).

Actual result:
--------------
nothing; blank value

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-04 10:55 UTC] sniper@php.net
Using latest CVS:

[jani@rh62 jani]$ date
Mon Aug  4 18:54:40 EEST 2003
[jani@rh62 jani]$ php -r '$offset = strtotime("+3 hours"); echo $offset,"\n",date("G", $offset);'
1060023283
21

No bug here.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 13:01:27 2025 UTC