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 bi

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 > less!) notice given.

Re: How to check if a DateTime is invalid (again - but this time without using eval)?

2017-07-10 Thread Zefram
Thomas (HFM) Wyant wrote: >One of the edge cases with eval {} is the possibility that $@ gets >clobbered before you get your hands on it. The possibility of it being clobbered by a destructor was fixed in 5.14. (Destructors that do this are considered buggy, for pre-5.14 perls, and are individuall

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 could

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

2017-07-10 Thread Eric Brine
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. On Mon, Jul 10, 2017 at 2:02 PM, Binarus wrote: > Dear experts, > > a few days ago I have got great help f

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

2017-07-10 Thread Binarus
Dear experts, a few days ago I have got great help from this list, so I hope I may ask another (probably stupid) question (I am now having the opposite problem than back then): Using DateTime, is it possible to tell in advance if a certain date-time which is given in a certain locale will be ambi