Rafael Morales wrote:
> Hi list !!!.
> 
> This is my first post, and I need to print the milliseconds in the
> date, this is the format I need.
> 
> YYYY-MM-DD HH-MM-SS-milliseconds.
> 
> I have not found how to do this.

"perldoc DateTime" would have told you how to format milliseconds.

  use DateTime;
  use Time::HiRes qw(time);
  my $dt = DateTime->from_epoch( epoch => time() );
  print $dt->strftime('%Y-%m-%d %H-%M-%S-%3N'), "\n";

Philip
  • Milliseconds Rafael Morales
    • RE: Milliseconds Garrett, Philip \(MAN-Corporate\)

Reply via email to