Re: Daylight savings time timezone conversion automatically?

2008-03-26 Thread Dave Rolsky
On Wed, 26 Mar 2008, Ewald Beekman wrote: I never knew about the "clone" method and "is_dst" on itself is not available as method inside DateTime::TimeZone That's cause a timezone is a description of a historical set of changes ("-0700 until X date"). Without that date, it can't know if DST i

Re: Daylight savings time timezone conversion automatically?

2008-03-26 Thread William Janoch
CAUTION: Adding half a year would be prone to error near the "time change" dates. 2:01 am 6 months from now might not even exist if that date is "spring forward" day. It's unlikely that you'd ever need to, but If you ever had to, make sure you use a mid summer date like July 1, or mid wint

Re: Daylight savings time timezone conversion automatically?

2008-03-26 Thread Ewald Beekman
Great! That does the trick. I never knew about the "clone" method and "is_dst" on itself is not available as method inside DateTime::TimeZone but together it's excactly what i need. thanks very much. Ewald... On Wed, Mar 26, 2008 at 01:01:03PM -0700, Tatsuhiko Miyagawa wrote: > On Wed, Mar 26, 2

Re: Daylight savings time timezone conversion automatically?

2008-03-26 Thread Tatsuhiko Miyagawa
On Wed, Mar 26, 2008 at 11:34 AM, Ewald Beekman <[EMAIL PROTECTED]> wrote: > Is there a way to see if DST is in effect on a > returned time zone object ? > For instance, i have got a loop like this: > > my @list = DateTime::TimeZone->all_names; > foreach $zone (@list) { > next unless ($

Re: Daylight savings time timezone conversion automatically?

2008-03-26 Thread Ewald Beekman
Is there a way to see if DST is in effect on a returned time zone object ? For instance, i have got a loop like this: my @list = DateTime::TimeZone->all_names; foreach $zone (@list) { next unless ($zone =~ /\//);# skip timezone links in the list $dt = DateTime-

Re: Daylight savings time timezone conversion automatically?

2008-03-12 Thread Dave Rolsky
On Thu, 13 Mar 2008, Rick Measham wrote: William Heath wrote: I think I figured it out, what is important to understand is that you can't choose EST, you must choose a country/city for the function to adjust for DST automatically. My question was probably too simple for you to give me this sol

Re: Daylight savings time timezone conversion automatically?

2008-03-12 Thread Rick Measham
William Heath wrote: I think I figured it out, what is important to understand is that you can't choose EST, you must choose a country/city for the function to adjust for DST automatically. My question was probably too simple for you to give me this solution but I did figure it out. Does that m

Re: Daylight savings time timezone conversion automatically?

2008-03-12 Thread William Heath
Thanks All, I think I figured it out, what is important to understand is that you can't choose EST, you must choose a country/city for the function to adjust for DST automatically. My question was probably too simple for you to give me this solution but I did figure it out. Does that make sense

Re: Daylight savings time timezone conversion automatically?

2008-03-12 Thread Dave Rolsky
On Wed, 12 Mar 2008, Rick Measham wrote: printf( "%s%02d%02d", $dt->offset >= 0 ? '+' : '-', int($dt->offset / 60 / 60), ($dt->offset / 60) % 60 ); or better yet ... print DateTime::TimeZone->offset_as_string($offset) -dave /*== VegGuide.O

Re: Daylight savings time timezone conversion automatically?

2008-03-11 Thread Rick Measham
William Heath wrote: The trouble is I need to find the GMT offset for a timezone and I don't know how to do this correctly for daylight saving time. my $dt = new DateTime( year => 2008, month => 3, day => 12, hour => 16, time_zone => 'Australia/Melbou

Daylight savings time timezone conversion automatically?

2008-03-11 Thread William Heath
Hello All, I love perl and am grateful to have DateTime::TimeZone! The trouble is I need to find the GMT offset for a timezone and I don't know how to do this correctly for daylight saving time. Is there no way to find this GMT offset automatically or do I have to manually check the date, see if