Seconds left in day + DST

[email protected] (Jim Spath)
Newsgroups perl.datetime
Message-ID <[email protected]>
I'm a bit unclear on how to properly deal with DST when determining the 
number of seconds left in a day.

Here's what I have now:

my $now = DateTime->now(time_zone => 'local');

my $tom =
   ($dt + DateTime::Duration->new(days => 1))->truncate(to => 'day'));

my $seconds_left = $tom_dt->epoch() - $dt->epoch();

It seems to work fine, but another developer here mentioned that it 
might not handle DST properly, although he wasn't sure how to do it himself.

I'd like it to return the number of seconds until the next day, in my 
local timezone (EST).

Thanks!
- Jim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.