Here is one approach,although it depends on a lot of undocumented pieces of DateTime::TimeZone, it was the only way I could find at the time...

#!/usr/local/bin/perl -w ################## use DateTime::TimeZone; use Data::Dumper; my $tz = shift || 'America/New_York'; my $utc_start = DateTime::TimeZone::UTC_START(); my $utc_end = DateTime::TimeZone::UTC_END(); my $short_name = DateTime::TimeZone::SHORT_NAME(); my $tzobj = DateTime::TimeZone->new( name => $tz ); foreach my $span ( @{ $tzobj->{ 'spans' } } ) { my $start = RD->new( $span->[ $utc_start ], $tzobj, )->as_datetime; my $end = RD->new( $span->[ $utc_end ], $tzobj, )->as_datetime; print "$span->[ $short_name ]: $start - $end\n"; } package RD; use constant SECONDS_PER_DAY => 86400; sub new { my $class = shift; my $seconds = shift; my $timezone = shift; my $self = bless( [ $seconds, $timezone ], $class, ); return $self; } sub time_zone { shift->[1] } sub utc_rd_values { my ( $self ) = @_; my $days = int( $self->[0] / SECONDS_PER_DAY ); my $seconds = int( $self->[0] % SECONDS_PER_DAY ); return ( $days, $seconds, 0 ); } sub as_datetime { my ( $self ) = @_; if ( $self->[0] eq '-inf' ) { return DateTime::Infinite::Past->new; } if ( $self->[0] eq 'inf' ) { return DateTime::Infinite::Future->new; } return DateTime->from_object( object => $self ); }

We're not surrounded, we're in a target-rich environment!

In reply to Re: Is there a way to pull dst start/end from DateTime.pm? by jasonk
in thread Is there a way to pull dst start/end from DateTime.pm? by suaveant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.