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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC