Re: Seconds left in day + DST

[email protected] ("Dr.Ruud")
Newsgroups perl.datetime
Organization Chaos rules.
Message-ID <[email protected]>
Rick Measham schreef:
> P DD wrote:

>> my $tom = ($now + DateTime::Duration->new(days => 1))->
>> truncate(to => 'day');
> 
> Can I suggest this for neater code:
> my $tom = $dt->clone->add( days => 1 )->truncate( to => 'day' );

I seem to remember that adding 24 hours is safer than adding 1 day. 
(to never land on a non-existing DT value)

-- 
Affijn, Ruud

"Gewoon is een tijger."
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.