Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Location
    Nepal
    Posts
    32

    Unanswered: How to subtract two date in Perl?

    Hi all,

    I have two datetime as string in variable how i can subtract to get the different in seconds?


    $startdat = "2007-11-17 12:50:22";
    $stopdat = "2007-11-17 12:53:22";

    $result = $stopdat - $startdat;

    But it is not working, can you guys please help to get the differences in sec?

  2. #2
    Join Date
    Feb 2004
    Posts
    30
    You may refer to the following URL:

    http://www.unix.org.ua/orelly/perl/cookbook/ch03_06.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •