| Re: Current Time with 5 digits of milliseconds |
|
 |
|
 |
|
 |
|
 |
Author: RedGrittyBrick Date: May 12, 2008 03:44
> 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?
>
--
RGB
|