php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35143 gettimeofday() ignores current time zone
Submitted: 2005-11-07 20:38 UTC Modified: 2005-11-20 21:14 UTC
From: tomas_matousek at hotmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.1.0RC4 OS: WinXP
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: tomas_matousek at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-11-07 20:38 UTC] tomas_matousek at hotmail dot com
Description:
------------
I assume gettimeofday() should return "minuteswest" and "dsttime" according to the current time zone set by date_default_timezone_set, right?
It doesn't work. It returns the system time zone instead.

Reproduce code:
---------------
date_default_timezone_set("UTC");

var_dump(date_default_timezone_get());

var_dump(gettimeofday());

Expected result:
----------------
string(3) "UTC"
array(4) {
  ["sec"]=>
  int(1131392140)
  ["usec"]=>
  int(31336)
  ["minuteswest"]=>
  int(0)
  ["dsttime"]=>
  int(0)
}



Actual result:
--------------
string(3) "UTC"
array(4) {
  ["sec"]=>
  int(1131392140)
  ["usec"]=>
  int(31336)
  ["minuteswest"]=>
  int(-60)
  ["dsttime"]=>
  int(1)
}



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-07 21:38 UTC] sniper@php.net
Assigned to the master of timezones.
 [2005-11-20 21:14 UTC] derick@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed for 5.1.0 and 6.0.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC