Re: TimeZones and politics Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Bill Ricker
> Well, first of all, I did not want to insult or even criticize anybody. > Please forgive me if my wording even made the slightest impression of > doing so - regrettably, I am not a native English speaker. In which case, you are doing very well, i would not have guessed. ( If I replied in French

Re: TimeZones and politics Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Eric Brine
On Wed, Jul 12, 2017 at 11:07 AM, Binarus wrote: > On 11.07.2017 20:50, Bill Ricker wrote: > > On Tue, Jul 11, 2017 at 4:07 AM, Binarus wrote: > >> > >> On 10.07.2017 20:14, Eric Brine wrote: > >>> I don't understand the conditions. The law determines when

Re: TimeZones and politics Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Binarus
On 12.07.2017 17:07, Binarus wrote: > [...] None of my Linux > servers and applications (written by me or others) never suffered from a > problem due to incorrect time zone data. Of course, I meant "ever" instead of "never" in the sentence above. Regards, Binarus

Re: TimeZones and politics Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Binarus
On 11.07.2017 20:50, Bill Ricker wrote: > On Tue, Jul 11, 2017 at 4:07 AM, Binarus wrote: >> >> On 10.07.2017 20:14, Eric Brine wrote: >>> I don't understand the conditions. The law determines when the switching >>> of offsets from UTC happen, not some person. The switch doesn't

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Zefram
Binarus wrote: >So is there any change to add an according API function to DT:TZ? Yes, but we wouldn't want to rush it. There's more than one implementation of the API, and we want to be sure to design it correctly the first time. Perhaps it could be a ->offsets_for_local_datetime method (note

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Binarus
On 11.07.2017 18:29, Karen Etheridge wrote: > On Tue, Jul 11, 2017 at 1:46 AM, Binarus > wrote: >> But if the application misbehaves because there is no correct time zone >> data available at that moment, I won't get into trouble. No reasonable >>

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-12 Thread Binarus
On 11.07.2017 15:53, Zefram wrote: > Binarus wrote: >> As the documentation tells us, DateTime always chooses the later time >> when calculating with ambiguous times, > > This logic is actually in DateTime::TimeZone, where DateTime invokes > it via the ->offset_for_local_datetime method. The

Re: TimeZones and politics Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Zefram
Bill Ricker wrote: >On Tue, Jul 11, 2017 at 4:07 AM, Binarus wrote: >> and the next law could determine the switch to >> happen at 08:48:27 am, and > >It could in theory, but would be beyond atypical. There have historically been some DST rules calling for changes at 00:01.

TimeZones and politics Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Bill Ricker
On Tue, Jul 11, 2017 at 4:07 AM, Binarus wrote: > > On 10.07.2017 20:14, Eric Brine wrote: > > I don't understand the conditions. The law determines when the switching > > of offsets from UTC happen, not some person. The switch doesn't happen > > at 08:48:27 am in Chicago; it

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Zefram
Binarus wrote: >Did you memorize the tzfile of 1969 :-) I looked through the Olson source files. I could also have automated a search through the compiled zone data. -zefram

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Zefram
Binarus wrote: >As the documentation tells us, DateTime always chooses the later time >when calculating with ambiguous times, This logic is actually in DateTime::TimeZone, where DateTime invokes it via the ->offset_for_local_datetime method. The internal logic is able to walk the sequence of

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Zefram
Dave Rolsky wrote: >If you're trying to avoid these, the best advice I could give would be to >avoid the 12am-4am window, which AFAIK is when most (all?) transitions have >occurred historically. Most, but there are both historical and current exceptions. America/Godthab (west Greenland) changes

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Binarus
On 11.07.2017 01:09, Zefram wrote: > Binarus wrote: >> Using DateTime, is it possible to tell in advance if a certain date-time >> which is given in a certain locale will be ambiguous due to switching >>from DST to standard time? > > That is tricky. I don't think our APIs provide any way to do

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Binarus
On 10.07.2017 23:17, Bill Ricker wrote: > On Mon, Jul 10, 2017 at 2:19 PM, Dave Rolsky > wrote: > >[...] > If you're trying to avoid these, the best advice I could give would > be to avoid the 12am-4am window, which AFAIK is when most (all?) >

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Binarus
On 10.07.2017 20:19, Dave Rolsky wrote: > While you could in theory write code that would be correct for all past > datetimes, the future doesn't work the same way. As Eric noted, time > zones are political. I have seen DST transitions altered with mere days > (or less!) notice given. This means

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-11 Thread Binarus
On 10.07.2017 20:14, Eric Brine wrote: > I don't understand the conditions. The law determines when the switching > of offsets from UTC happen, not some person. The switch doesn't happen > at 08:48:27 am in Chicago; it happens at 2am. This point of view is a bit U.S. centric. Indeed, you are

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-10 Thread Zefram
Binarus wrote: >Using DateTime, is it possible to tell in advance if a certain date-time >which is given in a certain locale will be ambiguous due to switching >from DST to standard time? That is tricky. I don't think our APIs provide any way to do it. Thinking about the facilities available a

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-10 Thread Bill Ricker
On Mon, Jul 10, 2017 at 2:19 PM, Dave Rolsky wrote: > While you could in theory write code that would be correct for all past > datetimes, the future doesn't work the same way. As Eric noted, time zones > are political. I have seen DST transitions altered with mere days (or >

Re: How to tell (in advance) if a date-time is ambiguous?

2017-07-10 Thread Dave Rolsky
While you could in theory write code that would be correct for all past datetimes, the future doesn't work the same way. As Eric noted, time zones are political. I have seen DST transitions altered with mere days (or less!) notice given. This means that anything you determine about the future