SparkeyG has asked for the wisdom of the Perl Monks concerning the following question:
Output:use strict; use warnings; use DateTime; use DateTime::Format::Strptime; my $val = "2011-11-11 14:30:00.999981"; my $format = new DateTime::Format::Strptime( pattern => '%F %T.%N', time_zone => 'GMT', ); my $date = $format->parse_datetime($val); print $date->strftime("%F %T.%3N %Z")."\n";
I would expect:2011-11-11 14:30:00.1000 UTC
2011-11-11 14:30:01.000 UTC
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Rounding Issue in DateTime strftime?
by runrig (Abbot) on Nov 14, 2011 at 18:23 UTC | |
by SparkeyG (Curate) on Nov 14, 2011 at 19:03 UTC | |
by runrig (Abbot) on Nov 14, 2011 at 19:24 UTC | |
by SparkeyG (Curate) on Nov 14, 2011 at 19:39 UTC | |
by runrig (Abbot) on Jan 27, 2012 at 18:55 UTC |