php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46552 new DateTime('with timezone') getName() problem
Submitted: 2008-11-12 09:08 UTC Modified: 2008-11-20 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: shj at xenosi dot de Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-11-12 09:08 UTC] shj at xenosi dot de
Description:
------------
new DateTimeZone('PST')
and
new DateTimeZone('America/Los_Angeles')
are same.

please, modify getTimezone()->getName() output.
thank you.

Reproduce code:
---------------
<?php

$datetime = new DateTime('Dec-01-08 08:17:40 PST');
echo "new PST\n";
echo $datetime->getTimezone()->getName();
echo "\n";
echo $datetime->format('Y-m-d H:i:s');
echo "\n";
$pst = new DateTimeZone('PST');
$datetime->setTimezone($pst);
echo "DateTimeZone PST\n";
echo $datetime->getTimezone()->getName();
echo "\n";
echo $datetime->format('Y-m-d H:i:s');
echo "\n";
$kst = new DateTimeZone('KST');
$datetime->setTimezone($kst);
echo "DateTimeZone KST\n";
echo $datetime->getTimezone()->getName();
echo "\n";
echo $datetime->format('Y-m-d H:i:s');
echo "\n";

?>


Expected result:
----------------
new PST
PST
2008-12-01 08:17:40
DateTimeZone PST
America/Los_Angeles
2008-12-01 08:17:40
DateTimeZone KST
Asia/Seoul
2008-12-02 01:17:40


Actual result:
--------------
new PST
America/Los_Angeles
2008-12-01 08:17:40
DateTimeZone PST
America/Los_Angeles
2008-12-01 08:17:40
DateTimeZone KST
Asia/Seoul
2008-12-02 01:17:40


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-12 13:09 UTC] jani@php.net
Please try using this CVS snapshot:

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

  http://windows.php.net/snapshots/


 [2008-11-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 03:01:29 2024 UTC