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
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: 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-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 01 03:01:29 2025 UTC