Issue with finding next DST change, date math error?

2012-05-25 Thread Anthony Ball
I never had any luck finding anything to give me the future DST changes for a timezone so I worked out how to get it on my own, but recently I upgraded from something like DateTime 0.36 to 0.74 and something really strange is happening. In my code I set the date to the start of the year and then

Re: Issue with finding next DST change, date math error?

2012-05-25 Thread Rick Measham
Back in 2007 I wrote about some code I wrote in 2003. No idea if it'd be useful. http://grokbase.com/t/perl/datetime/073612z62x/event-dst-pulling-dst-changes-from-datetime Cheers! Rick Measham  On 23/05/2012, at 6:59, Anthony Ball a...@suave.net wrote: I never had any luck finding anything

Re: Issue with finding next DST change, date math error?

2012-05-25 Thread Zefram
Anthony Ball wrote: I never had any luck finding anything to give me the future DST changes for a timezone We don't have an API for that. We've discussed it a bit, and will most likely add such a thing to the DT:TZ API after we've switched to the reimplemented DT:TZ, scheduled for 2012-09-01.

RE: Issue with finding next DST change, date math error?

2012-05-25 Thread Metz, Bobby
From: Zefram [mailto:zef...@fysh.org] The form of epoch seconds implemented by DateTime doesn't count leap seconds. So in the time scale supplied by DateTime it is *not* I wasn't aware of the bit about epoch Zefram pointed out. Can someone answer this related hypothetical for me? 1. You

Re: Issue with finding next DST change, date math error?

2012-05-25 Thread Steve Allen
On May 25, 8:16 am, zef...@fysh.org (Zefram) wrote: The form of epoch seconds implemented by DateTime doesn't count leap seconds. So in the time scale supplied by DateTime it is *not* a linear count of elapsed seconds from a starting point. It is a linear count of mean solar seconds, but not

Re: Issue with finding next DST change, date math error?

2012-05-25 Thread Anthony Ball
So is that a bug in DateTime? If I subtract one epoch time from another and add shouldn't they end up together? Or is it just too weird to code for? Maybe a better solution than adding seconds would be just moving to that epoch slice, I'd have to create a new datetime using from_epoch (unless

Re: Issue with finding next DST change, date math error?

2012-05-25 Thread Rick Measham
Not a bug in DateTime. This is consistent with the C libraries that underpin Perl and other stuff. If you call the internal time() function every second over a leap second you'll see the same epoch value twice. It's about defining what the epoch second actually means. It's the number of solar