Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
rfc:datetime_and_daylight_saving_time [2011/09/20 16:21] – update version for last change danielc | rfc:datetime_and_daylight_saving_time [2011/11/02 12:59] – <kristen wiig>"It's approved!"</kristen wiig> danielc |
---|
====== Request for Comments: DateTime and Daylight Saving Time Transitions ====== | ====== Request for Comments: DateTime and Daylight Saving Time Transitions ====== |
* Version: 0.4 | * Version: 1.0 |
* Date: 2011-09-20 | * Date: 2011-10-18 |
* Author: Daniel Convissor <danielc@php.net> with feedback from Derick Rethans <derick@php.net> | * Author: Daniel Convissor <danielc@php.net> with feedback from Derick Rethans <derick@php.net> |
* Status: Draft | * Status: Approved ([[rfc:datetime_and_daylight_saving_time:vote|voting results]]) |
* First Published at: https://wiki.php.net/rfc/datetime_and_daylight_saving_time | * First Published at: https://wiki.php.net/rfc/datetime_and_daylight_saving_time |
| |
2:00 am. The forward transition (in spring) jumps to 3:00 am, skipping | 2:00 am. The forward transition (in spring) jumps to 3:00 am, skipping |
over the hour of 2 am. The backward transition (in fall) jumps back to | over the hour of 2 am. The backward transition (in fall) jumps back to |
1:00 am, repeating the hour of 1am. | 1:00 am, repeating the hour of 1 am. |
| |
Other time zones use different transition quantities and times. | Other time zone changes have different lengths of time and take effect |
| at different days/times. |
| |
| |
(between ''1:00:00 am'' and ''1:59:59 am'' Standard Time). | (between ''1:00:00 am'' and ''1:59:59 am'' Standard Time). |
| |
This RFC proposes adjusting the time string parser to handle strings ending | This RFC proposes adjusting the time string parser to handle strings containing |
in ''DST'' and ''ST''. When ''DST'' or ''ST'' are not present, PHP will use | ''DST'' and ''ST''. When ''DST'' or ''ST'' are not present, PHP will use |
the current behavior, which uses the time zone offset in place at the | the current behavior, which uses the time zone offset in place at the |
specified time and uses DST offset during the repeated hour during backward | specified time and uses DST offset during the repeated hour during backward |
| |
Reminder: the time zone in the examples is ''America/New_York''. | Reminder: the time zone in the examples is ''America/New_York''. |
So "(ST)" represents Eastern Standard Time/EST/-0500 and "(DT)" represents Eastern Daylight Time/EDT/-0400. | So "(ST)" represents Eastern Standard Time/EST/-0500 and "(DT)" |
| represents Eastern Daylight Time/EDT/-0400. |
| |
The behaviors indicated here are covered by unit tests in ''ext/date/tests'': | The behaviors indicated here are covered by unit tests in ''ext/date/tests'': |
* xxxx.phpt | * rfc-datetime_and_daylight_saving_time-type1.phpt |
* yyyy.phpt | * rfc-datetime_and_daylight_saving_time-type2.phpt |
* zzzz.phpt | * rfc-datetime_and_daylight_saving_time-type3.phpt |
| |
Each output line in the test files is prefixed with an identifier | Each output line in the test files is prefixed with an identifier |
that corresponds to the ''phpt'' columns in the tables below. | that corresponds to the ''phpt'' columns in the tables below. |
| |
Actual results for Zone Types 1 and 2 are shown as ''N/A'' for the moment | Actual results for Zone Types 1 and 2 are shown as ''N/A'' for the moment. |
because results are tainted by | All Zone Type 1 tests pass. Zone Type 2 results are tainted by |
[[https://bugs.php.net/bug.php?id=55253|Bug 55253]]. | [[https://bugs.php.net/bug.php?id=55253|Bug 55253]]. |
| |
| ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T04:30:00''//(ST)// | P0DT21H | fd4 | | | | ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T04:30:00''//(ST)// | P0DT21H | fd4 | | |
| ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T01:30:00''//(ST)// | P1DT0H | fd5 | | | | ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T01:30:00''//(ST)// | P1DT0H | fd5 | | |
| | ''2010-03-14T03:30:00''//(DT)// | ''2010-03-13T03:30:00''//(ST)// | P1DT0H | fd6 | | |
| | ''2010-03-14T03:30:00''//(DT)// | ''2010-03-13T02:30:00''//(ST)// | P1DT1H | fd7 | | |
| |
== add() == | == add() == |
| ''2010-03-14T01:30:00''//(ST)// | PT21H | ''2010-03-13T04:30:00''//(ST)// | fs4 | | | | ''2010-03-14T01:30:00''//(ST)// | PT21H | ''2010-03-13T04:30:00''//(ST)// | fs4 | | |
| ''2010-03-14T01:30:00''//(ST)// | P1D | ''2010-03-13T01:30:00''//(ST)// | fs5 | | | | ''2010-03-14T01:30:00''//(ST)// | P1D | ''2010-03-13T01:30:00''//(ST)// | fs5 | | |
| | ''2010-03-15T03:30:00''//(DT)// | P1D | ''2010-03-14T03:30:00''//(DT)// | fs6 | | |
| | ''2010-03-15T02:30:00''//(DT)// | P1D | ''2010-03-14T03:30:00''//(DT)// | fs7 | | |
| |
=== Zone Types 1 & 2 === | === Zone Types 1 & 2 === |
| ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T04:30:00''//(ST)// | P0DT21H | fd4 | | | | ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T04:30:00''//(ST)// | P0DT21H | fd4 | | |
| ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T01:30:00''//(ST)// | P1DT0H | fd5 | | | | ''2010-03-14T01:30:00''//(ST)// | ''2010-03-13T01:30:00''//(ST)// | P1DT0H | fd5 | | |
| | ''2010-03-14T03:30:00''//(DT)// | ''2010-03-13T03:30:00''//(ST)// | P0DT23H | fd6 | | |
| | ''2010-03-14T03:30:00''//(DT)// | ''2010-03-13T02:30:00''//(ST)// | P1DT0H | fd7 | | |
| |
== add() == | == add() == |
| ''2010-03-14T01:30:00''//(ST)// | PT21H | ''2010-03-13T04:30:00''//(ST)// | fs4 | N/A | | | ''2010-03-14T01:30:00''//(ST)// | PT21H | ''2010-03-13T04:30:00''//(ST)// | fs4 | N/A | |
| ''2010-03-14T01:30:00''//(ST)// | P1D | ''2010-03-13T01:30:00''//(ST)// | fs5 | N/A | | | ''2010-03-14T01:30:00''//(ST)// | P1D | ''2010-03-13T01:30:00''//(ST)// | fs5 | N/A | |
| | ''2010-03-15T03:30:00''//(DT)// | P1D | ''2010-03-14T03:30:00''//(DT)// | fs6 | N/A | |
| | ''2010-03-15T02:30:00''//(DT)// | P1D | ''2010-03-14T02:30:00''//(DT)// | fs7 | N/A | |
| |
==== Backward Transitions ==== | ==== Backward Transitions ==== |
| ''2010-11-06T01:30:00''//(DT)// | P1D | ''2010-11-07T01:30:00''//(DT)// | ba7 | | | | ''2010-11-06T01:30:00''//(DT)// | P1D | ''2010-11-07T01:30:00''//(DT)// | ba7 | | |
| ''2010-11-06T01:30:00''//(DT)// | P1DT1H | ''2010-11-07T01:30:00''//(ST)// | ba8 | ''2010-11-07T02:30:00''//(ST)// | | | ''2010-11-06T01:30:00''//(DT)// | P1DT1H | ''2010-11-07T01:30:00''//(ST)// | ba8 | ''2010-11-07T02:30:00''//(ST)// | |
| | ''2010-11-06T04:30:00''//(DT)// | PT25H | ''2010-11-07T04:30:00''//(ST)// | ba9 | ''2010-11-07T05:30:00''//(ST)// | |
| | ''2010-11-06T03:30:00''//(DT)// | P1D | ''2010-11-07T03:30:00''//(ST)// | ba10| | |
| | ''2010-11-06T02:30:00''//(DT)// | P1D | ''2010-11-07T02:30:00''//(ST)// | ba11| | |
| |
== sub() == | == sub() == |
| ''2010-11-07T01:30:00''//(DT)// | PT21H | ''2010-11-06T04:30:00''//(DT)// | bs6 | | | | ''2010-11-07T01:30:00''//(DT)// | PT21H | ''2010-11-06T04:30:00''//(DT)// | bs6 | | |
| ''2010-11-07T01:30:00''//(DT)// | P1D | ''2010-11-06T01:30:00''//(DT)// | bs7 | | | | ''2010-11-07T01:30:00''//(DT)// | P1D | ''2010-11-06T01:30:00''//(DT)// | bs7 | | |
| ''2010-11-07T01:30:00''//(ST)// | P1DT1H | ''2010-11-06T01:30:00''//(DT)// | bs8 | ''2010-11-06T00:30:00''//(DT)// | | | ''2010-11-07T01:30:00''//(ST)// | P1DT1H | ''2010-11-06T00:30:00''//(DT)// | bs8 | | |
| | ''2010-11-07T03:30:00''//(ST)// | P1D | ''2010-11-06T03:30:00''//(DT)// | bs9 | | |
| | ''2010-11-07T02:30:00''//(ST)// | P1D | ''2010-11-06T02:30:00''//(DT)// | bs10 | | |
| |
=== Zone Types 1 & 2 === | === Zone Types 1 & 2 === |
| ''2010-11-06T01:30:00''//(DT)// | P1D | ''2010-11-07T01:30:00''//(DT)// | ba7 | N/A | | | ''2010-11-06T01:30:00''//(DT)// | P1D | ''2010-11-07T01:30:00''//(DT)// | ba7 | N/A | |
| ''2010-11-06T01:30:00''//(DT)// | P1DT1H | ''2010-11-07T02:30:00''//(DT)// | ba8 | N/A | | | ''2010-11-06T01:30:00''//(DT)// | P1DT1H | ''2010-11-07T02:30:00''//(DT)// | ba8 | N/A | |
| | ''2010-11-06T04:30:00''//(DT)// | PT25H | ''2010-11-07T05:30:00''//(DT)// | ba9 | N/A | |
| | ''2010-11-06T03:30:00''//(DT)// | P1D | ''2010-11-07T03:30:00''//(DT)// | ba10| N/A | |
| | ''2010-11-06T02:30:00''//(DT)// | P1D | ''2010-11-07T02:30:00''//(DT)// | ba11| N/A | |
| |
== sub() == | == sub() == |
| ''2010-11-07T04:30:00''//(ST)// | P1D | ''2010-11-06T04:30:00''//(ST)// | bs2 | N/A | | | ''2010-11-07T04:30:00''//(ST)// | P1D | ''2010-11-06T04:30:00''//(ST)// | bs2 | N/A | |
| ''2010-11-07T03:30:00''//(ST)// | PT24H | ''2010-11-06T03:30:00''//(ST)// | bs3 | N/A | | | ''2010-11-07T03:30:00''//(ST)// | PT24H | ''2010-11-06T03:30:00''//(ST)// | bs3 | N/A | |
| ''2010-11-07T02:30:00''//(ST)// | PT23H | ''2010-11-06T04:30:00''//(ST)// | bs4 | N/A | | | ''2010-11-07T02:30:00''//(ST)// | PT23H | ''2010-11-06T03:30:00''//(ST)// | bs4 | N/A | |
| ''2010-11-07T01:30:00''//(ST)// | PT22H | ''2010-11-06T04:30:00''//(ST)// | bs5 | N/A | | | ''2010-11-07T01:30:00''//(ST)// | PT22H | ''2010-11-06T03:30:00''//(ST)// | bs5 | N/A | |
| ''2010-11-07T01:30:00''//(DT)// | PT21H | ''2010-11-06T04:30:00''//(DT)// | bs6 | N/A | | | ''2010-11-07T01:30:00''//(DT)// | PT21H | ''2010-11-06T04:30:00''//(DT)// | bs6 | N/A | |
| ''2010-11-07T01:30:00''//(DT)// | P1D | ''2010-11-06T01:30:00''//(DT)// | bs7 | N/A | | | ''2010-11-07T01:30:00''//(DT)// | P1D | ''2010-11-06T01:30:00''//(DT)// | bs7 | N/A | |
| ''2010-11-07T01:30:00''//(ST)// | P1DT1H | ''2010-11-06T01:30:00''//(ST)// | bs8 | N/A | | | ''2010-11-07T01:30:00''//(ST)// | P1DT1H | ''2010-11-06T00:30:00''//(ST)// | bs8 | N/A | |
| | ''2010-11-07T03:30:00''//(ST)// | P1D | ''2010-11-06T03:30:00''//(ST)// | bs9 | N/A | |
| | ''2010-11-07T02:30:00''//(ST)// | P1D | ''2010-11-06T02:30:00''//(ST)// | bs10 | N/A | |
| |
| |
===== Other Issues? ===== | ===== Other Issues? ===== |
If you know of other problems, please add them here or bring them to the | If you know of other problems, please bring them to the attention of the authors. |
attention of the authors. | |
| |
| |
===== Changelog ===== | ===== Changelog ===== |