Clock changes in "America/New York":
When local daylight time was about to reach
Sunday, 3 November 2013, 02:00:00 clocks were turned backward 1 hour to
Sunday, 3 November 2013, 01:00:00 local standard time insteadClock changes in "Europe/Berlin":
When local daylight time was about to reach
Sunday, 27 October 2013, 03:00:00 clocks were turned backward 1 hour to
Sunday, 27 October 2013, 02:00:00 local standard time instead
How do I get these dates with PHP?
For example: how do I get the date "Sunday, 27 October 2013, 02:00:00" for Berlin 2014 without google ;)
And if I have a unixtimestamp that lies inside that hour, will it point to the first or the last hour?
I think getTransitions
is what you're after:
$timezone = new DateTimeZone("Europe/London");
$transitions = $timezone->getTransitions();
It's a bit of an eyesore to look at, I admit, and if you're confused as to why there are multiple entries returned in the array, it's because the exact date is different because in most regions it's based on the day of the week of a month (such as "last Sunday in October") not a specific date. For the above if you only wanted the upcoming transitions, you would add the timestamp_being argument:
$timezone = new DateTimeZone("Europe/London");
$transitions = $timezone->getTransitions(time());