title: How to get the date difference in seconds ,in perl
body: <p>I have two dates , (they are datetime objects).</p>
  
  <p>How can i get the  difference between these two dates, in seconds ?</p>
  
  <pre><code>my $givenDate1 =  DateTime-&gt;new(
        year       =&gt; 1982,
        month      =&gt; 10,
        day        =&gt; 25,
        hour       =&gt; 7,
        minute     =&gt; 19,
        second     =&gt; 35,
  
        time_zone  =&gt; 'UTC',
    );
  my $givenDate2 =  DateTime-&gt;new(
        year       =&gt; 1982,
        month      =&gt; 10,
        day        =&gt; 25,
        hour       =&gt; 7,
        minute     =&gt; 20,
        second     =&gt; 50,
  
        time_zone  =&gt; 'UTC',
    );
  </code></pre>
  
  <p>It should return the time difference as  75 secs</p>