php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67256 DateTimeZone::getTransitions
Submitted: 2014-05-12 11:04 UTC Modified: 2017-05-14 18:33 UTC
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: info at maxvis dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.5.12 OS: Windows/Linux
Private report: No CVE-ID: None
 [2014-05-12 11:04 UTC] info at maxvis dot de
Description:
------------
TypeTimeZone->getTransitions() return false 

---
From manual page: http://www.php.net/datetimezone.gettransitions
---


Test script:
---------------
$tz = new TypeTimeZone( 'CET' ); // Also GMT

print_r( $tz->getTransitions() );


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-10 09:26 UTC] bugs dot php dot net at chsc dot dk
See also bug 74562.
 [2017-05-14 18:33 UTC] heiglandreas@php.net
-Status: Open +Status: Not a bug
 [2017-05-14 18:33 UTC] heiglandreas@php.net
First: There's no `TypeTimeZone`, so I expect you're talking about DateTimeZone.

Second: What Transitions do you expect for a "Timezone" CET? It's central European Time. Offset to UTC +01:00 - And that NEVER changes! Because the "Timezone" with +02:00  Hours offset is CEST! 

The same applies for a "timezone" that's only defined by an offset!

The Transitions can ONLY be returned for a VALID timezone like "Europe/Berlin"! CET is a "Timezone Abbreviation" and +01:00 is a "Timezone Offset". So there is a difference in "new DateTimezone('Europe/BErlin');", "new DateTimezone('CET');" and "new DAteTimezone('+01:00');" which is the timezone-type.

Only Timezones with a timezone-type 3 can return a transition, the others can't because *they do not have one*!

YOu might want to have a look at https://3v4l.org/v4iEK and https://3v4l.org/beumK

By the way: DateTimezone::getLocation will *also* return false for Timezones of type 1 or 2!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 18:01:30 2024 UTC