title: perl regex to cut the microseconds in timestamp
body: <p>How can I remove/cut everything after dot (.) using regex in a timestamp? I would like to use the output to find time difference int the below code</p>
  
  <pre><code>  $_ = '2015/01/13 13:59:21.267-05:00';
    s/\.\d*//;
    print $_, "\n";
  </code></pre>
  
  <p>Current Output:</p>
  
  <pre><code>2015/01/13 13:59:21-05:00
  </code></pre>
  
  <p>Desired Output:</p>
  
  <pre><code>2015/01/13 13:59:21
  </code></pre>
  
  <p>Code for finding time difference:</p>
  
  <pre><code>use strict;
  use warnings;
  use Time::Piece;
  
  my $str1 = '2015/01/13 13:58:01.267-05:00';
  my $str2 = '2015/01/13 13:59:21.267-05:00';
  
  my @times = map Time::Piece-&gt;strptime((s/\.\d*//), '%Y/%m/%d %H:%M:%S'), $str1, $str2;
  my $delta = $times[1] - $times[0];
  print $delta-&gt;pretty;
  </code></pre>