php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33403 date() function support for "Asia/Dubai" timezone formats on Win32 platform.
Submitted: 2005-06-20 01:35 UTC Modified: 2005-07-02 13:14 UTC
From: nickj-phpbugs at nickj dot org Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5CVS-2005-06-20 OS: win32 only
Private report: No CVE-ID: None
 [2005-06-20 01:35 UTC] nickj-phpbugs at nickj dot org
Description:
------------
[Excerpt from bug 20382, for a separate problem that should be logged as a new bug]:

On the Win32 platform the date() format does not currently understand timezone names like "Asia/Dubai".

Example code:

<?php

putenv("TZ=Australia/Adelaide");
$tStamp = mktime (17, 17, 17, 1, 1, 1971);
print "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n";
$strtotime_tstamp = strtotime("Monday", $tStamp);
print "result=".date("l Y-m-d H:i:s T", $strtotime_tstamp)."\n";
print "wanted=Monday            00:00:00\n\n";

putenv("TZ=Asia/Baku");
$tStamp = mktime (17, 17, 17, 1, 1, 1971);
print "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n";
$strtotime_tstamp = strtotime("Monday", $tStamp);
print "result=".date("l Y-m-d H:i:s T", $strtotime_tstamp)."\n";
print "wanted=Monday            00:00:00\n\n";

putenv("TZ=Europe/Brussels");
$tStamp = mktime (17, 17, 17, 1, 1, 1971);
print "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n";
$strtotime_tstamp = strtotime("Monday", $tStamp);
print "result=".date("l Y-m-d H:i:s T", $strtotime_tstamp)."\n";
print "wanted=Monday            00:00:00\n\n";

?>

======================================================
Results on a Windows2000 SP4 box are as follows:

G:\PHP bugs\php5.1-dev\php5-win32-200506171830>php-cgi.exe ..\..\new-test.php
Content-type: text/html
X-Powered-By: PHP/5.1.0-dev

tStamp=Friday 1971-01-01 17:17:17 Aus
result=Sunday 1971-01-03 14:30:00 Aus
wanted=Monday            00:00:00

tStamp=Friday 1971-01-01 17:17:17 Asi
result=Sunday 1971-01-03 20:00:00 Asi
wanted=Monday            00:00:00

tStamp=Friday 1971-01-01 17:17:17 Eur
result=Sunday 1971-01-03 23:00:00 Eur
wanted=Monday            00:00:00

G:\PHP bugs\php5.1-dev\php5-win32-200506171830>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-20 01:49 UTC] sniper@php.net
And assigned to derick. :)

 [2005-06-30 23:41 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

This should work now (but wait until the next snapshot is generated).
 [2005-07-01 09:27 UTC] nickj-phpbugs at nickj dot org
Building of 5.1 CVS snapshots on Windows seems to have been stalled today, so I have been unable to verify fix - will do this on Monday instead.
 [2005-07-01 09:39 UTC] sniper@php.net
Then give the feedback when you have it..
 [2005-07-02 13:14 UTC] nickj-phpbugs at nickj dot org
Confirmed fixed in php5-win32-200507020230.

Thank you!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC