|
Posted by RedGrittyBrick on May 12, 2008, 6:44 am
Please log in for more thread options
ambarish.mitra@gmail.com wrote:
> I need to get the current date-time with milliseconds upto 5 places of
> precision.
>
> That is, 20080512T12094565266 => YYYY MM DD T HH mm SS ms-5 digits
>
> Here, 65266 is the milli-second with 5 places of precision.
No, 652.66 would be milliseconds with 5 digit (two decimal places) precision
>
>
> I tried with the module DateTime, but that does not give the
> milliseconds.
>
> use DateTime;
> my $dt = DateTime->now( time_zone => 'floating' );
C> perl -mDateTime -e "$dt=DateTime->now; print $dt->second"
29
C> perl -mDateTime -e "$dt=DateTime->now; print $dt->nanosecond"
0
>
>
> Any idea how this can be achieved in Perl?
>
http://perldoc.perl.org/Time/HiRes.html
--
RGB
|