# [VOTE] DateTime and Daylight Saving Time Transitions

- Thread: https://externals.io/message/55958
- Original archive: https://news-web.php.net/php.internals/55958
- Started by Daniel Convissor on 2011-10-25T15:06:38+00:00
- Messages: 6
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #55958 — Daniel Convissor — 2011-10-25T15:06:38+00:00

URL: https://externals.io/message/55958#55958

Hi Folks:

Please take a moment to review the DateTime transitions RFC and vote on
it.  I encourage voting on it to ensure we are all on the same page as
to how PHP will handle transitions.  Voting is open through 10/31.

Read: https://wiki.php.net/rfc/datetime_and_daylight_saving_time
Vote: https://wiki.php.net/rfc/datetime_and_daylight_saving_time/vote

Thanks,

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

---

## #55959 — Thomas Nunninger — 2011-10-26T08:43:36+00:00

URL: https://externals.io/message/55958#55959 · In reply to: #55958

Hi,

sorry for late comment.

You write: "The ST or DST modifiers can only be used when specifying times 
during the backward transition period. Using the modifiers at other times 
will throw an exception in object-oriented style code while procedural style 
code will return false without triggering errors."

In my opinion this makes code more difficult as I need to check if the time is 
in the transition time. In my opinion it should be ok to add (D)ST all the 
time when it is (D)ST - and I don't see that it should be wrong (but I don't 
know enough about standard formats). Just ignore it internally if you don't 
need that information.

Thomas


Am Dienstag, 25. Oktober 2011 17:06:38 schrieb Daniel Convissor:
> Hi Folks:
>
> Please take a moment to review the DateTime transitions RFC and vote on
> it.  I encourage voting on it to ensure we are all on the same page as
> to how PHP will handle transitions.  Voting is open through 10/31.
>
> Read: https://wiki.php.net/rfc/datetime_and_daylight_saving_time
> Vote: https://wiki.php.net/rfc/datetime_and_daylight_saving_time/vote
>
> Thanks,
>
> --Dan
>
> --
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>             data intensive web and database programming
>                 http://www.AnalysisAndSolutions.com/
>  4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

---

## #55964 — Stas Malyshev — 2011-10-26T17:12:16+00:00

URL: https://externals.io/message/55958#55964 · In reply to: #55958

Hi!

> Please take a moment to review the DateTime transitions RFC and vote on
> it.  I encourage voting on it to ensure we are all on the same page as
> to how PHP will handle transitions.  Voting is open through 10/31.

Reading this RFC, I have some questions:

1. Would this ST/DST be used on format() too? If yes, then we;d get a 
format that nobody but PHP can parse. If no, then we don't have 
roundtrip for format/parse to read the same date as you wrote.

2. What is the intended use case for this syntax? I.e., if I am getting 
a date from somewhere, how this ST/DST is getting there? It can't come 
from the UI since no user and no external system would know how to 
generate these, and if it's supposed to be generated by the code, we get 
kind of chicken-and-egg problem here - to generate right ST/DST suffix, 
we already need to know what this date string says. So I'm a bit unclear 
on the use case here, especially if you're proposing to throw exceptions 
if the times are out of very specific hour - that means to create this 
suffix I'd have to know if we're in this hour or not - but how would I 
know that?

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #55965 — Derick Rethans — 2011-10-26T17:18:13+00:00

URL: https://externals.io/message/55958#55965 · In reply to: #55964

> > […]
> 
> Reading this RFC, I have some questions:
> 
> 1. Would this ST/DST be used on format() too? If yes, then we;d get a 
> format that nobody but PHP can parse. If no, then we don't have 
> roundtrip for format/parse to read the same date as you wrote.

No, why would it show up in format? The problem with expressing date and 
time when they exist twice is just an annoyance, and it's difficult to 
do a roundtrip in any case. We can add a format argument for it though, 
but I am not sure how useful that is.

> 2. What is the intended use case for this syntax? I.e., if I am getting a date
> from somewhere, how this ST/DST is getting there? It can't come from the UI
> since no user and no external system would know how to generate these, and if
> it's supposed to be generated by the code, we get kind of chicken-and-egg
> problem here - to generate right ST/DST suffix, we already need to know what
> this date string says. So I'm a bit unclear on the use case here, especially
> if you're proposing to throw exceptions if the times are out of very specific
> hour - that means to create this suffix I'd have to know if we're in this hour
> or not - but how would I know that?

If you don't know it, don't pass it in! Then PHP will guess, just as it 
does now and always has done. It's just an extra help in case you need 
to be specific about whether you want the ST or DST variant of "02:30".
 
You can just use EDT/EST anyway, and that would work too (but of course 
not set a tz=3 timezone on the object).

Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

---

## #55966 — Stas Malyshev — 2011-10-26T17:44:56+00:00

URL: https://externals.io/message/55958#55966 · In reply to: #55965

Hi!

> If you don't know it, don't pass it in! Then PHP will guess, just as it
> does now and always has done. It's just an extra help in case you need
> to be specific about whether you want the ST or DST variant of "02:30".
>
> You can just use EDT/EST anyway, and that would work too (but of course
> not set a tz=3 timezone on the object).

That's what I don't understand - so in the real code, what would be the 
use case where I'd want to use ST/DST? I.e., if I know the exact time, I 
could just use the timestamp or GMT time which doesn't have transitions. 
If I know only the formatted string, how I know if I should add ST/DST 
or not? I'm a bit unclear on that - how I can make a code that would be 
able to use this syntax.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #55989 — Daniel Convissor — 2011-10-29T12:00:05+00:00

URL: https://externals.io/message/55958#55989 · In reply to: #55966

Hi Stas:

> That's what I don't understand - so in the real code, what would be
> the use case where I'd want to use ST/DST? I.e., if I know the exact
> time, I could just use the timestamp or GMT time which doesn't have
> transitions.

Yeah, this stuff is very edge case.  It is for use when one needs to
have the transition information and create a time zone object that's in
the repeated period during a backward transition.  One case it's needed
is in unit testing DateTime.

Thanks,

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409
