On Fri, 03 Jun 2011 19:47:53 -0400, Uri Guttman wrote: > regardless of the need for millisecond info, use the POSIX::strftime > function as it does all of that formatting timestamps for you. and since > you pass it a string you can just interpolate the millisecond part into > that string.
Like so: $ perl -MPOSIX=strftime -MTime::HiRes=time -le '$t = time; $s=sprintf "% 06.3f", $t-int($t/60)*60; print strftime "%H:%M:$s %d:%m:%Y", localtime $t' 20:38:44.551 03:06:2011 -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 http://www.oreillyschool.com/courses/perl3/ -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
