php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19446 Incorrect Offset Reported
Submitted: 2002-09-16 21:00 UTC Modified: 2002-09-18 16:38 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: eangulus at hotmail dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.2.1 OS: Linux
Private report: No CVE-ID: None
 [2002-09-16 21:00 UTC] eangulus at hotmail dot com
I used this code to change timezones:

<?php
putenv('TZ=Asia/Calcutta');
print date('h:i:sa d/m/Y O T');
?>

Asia/Calcutta has an offset of +0530 GMT or 5.5 hours ahead of GMT.

It reported the O date value as +051800 I expected it to be +0530 or +053000

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-16 21:30 UTC] eangulus at hotmail dot com
Also occurs on other timezones that are not complete hours.
EG:
The Zones, Asia/Riyadh87, Asia/Riyadh88, Asia/Riyadh89 are the same and suppose to be +0345. But I get +03424. Also the Abreviation is reported as ?? I expected this to actually be either an actual abreviation.
 [2002-09-18 10:31 UTC] sean@php.net
Confirmed. Also happens to newfoundland. Seems to be all fractional offsets as stated:

<?php
putenv('TZ=Canada/Newfoundland');
print date('h:i:sa d/m/Y O T') ."<br />\n";
putenv('TZ=Canada/Eastern');
print date('h:i:sa d/m/Y O T') ."<br />\n";
?>
output:
12:55:52pm 18/09/2002 -021800 NDT
11:25:52am 18/09/2002 -0400 EDT

NOTE: Time is correct. Offset is incorrect.

S

 [2002-09-18 12:27 UTC] derick@php.net
<?php
putenv('TZ=Canada/Newfoundland');
print date('h:i:sa d/m/Y O T') ."<br />\n";
putenv('TZ=Canada/Eastern');
print date('h:i:sa d/m/Y O T') ."<br />\n";
?>
[Wed Sep 18 14:47:59 2002]  Script:  '-'
---------------------------------------
/dat/dev/php/php-4.3.0dev/Zend/zend_execute_API.c(282) : Block 0x0832FD00 status:
/dat/dev/php/php-4.3.0dev/Zend/zend_variables.c(44) : Actual location (location was relayed)
Beginning: OK (allocated on /dat/dev/php/php-4.3.0dev/ext/standard/datetime.c:377, 32 bytes)
      End: Overflown (magic=0x2A8F0054 instead of 0x2A8FCC84)
      2 byte(s) overflown
---------------------------------------
02:47:59pm 18/09/2002 -021800 NDT<br />
01:17:59pm 18/09/2002 -0400 EDT<br />
/dat/dev/php/php-4.3.0dev/ext/standard/datetime.c(377) :  Freeing 0x0832FD24 (32 bytes), script=-
 [2002-09-18 16:38 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 12:01:31 2024 UTC