title: How can I display the current datetime in the given format including microseconds in Perl?
body: <p>I want Perl to display current date and time in the following format:</p>
  
  <pre><code>2010-02-11 13:12:34.87876
  </code></pre>
  
  <p>I wrote this code:</p>
  
  <pre><code>use Time::localtime;
  my $tm = localtime;
  printf("It is now %04d-%02d-%02d %02d:%02d:%02d\n", $tm-&gt;year+1900,
      ($tm-&gt;mon)+1, $tm-&gt;mday, $tm-&gt;hour, $tm-&gt;min, $tm-&gt;sec);
  </code></pre>
  
  <p>and got:</p>
  
  <pre><code>2011-11-17 17:22:59
  </code></pre>
  
  <p>I do not know how to get the remaining <strong>.87876</strong> in the output. Could someone please help me?</p>