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' );
Cheers!
Rick Measham
--
Message protected for iSite by MailGuard: e-mail anti-virus, anti-spam and
co
For posterity... or as long as these mailing lists are archived.
my $now = DateTime->now(time_zone => 'local');
my $tom = ($now + DateTime::Duration->new(days => 1))->truncate(to =>
'day');
my $seconds_left = $tom->subtract_datetime_absolute($now)->seconds;
On Thu, Jun 19, 2008 at 1:03 PM, Dave
On Thu, 19 Jun 2008, Jim Spath wrote:
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'));
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() -
I came across a bug in DateTime::Format::Pg->parse_duration whereby it
does not parse the following intervals
@ x hours
@ y minutes
@ z seconds
This was frustrating because the format->duration does output these values.
Attached is a patch which fixes this behaviour.
Cheers,
Brett Gardner