Help for this page

Select Code to Download


  1. or download this
    $ cat datediff.pl 
    #!/usr/bin/perl -w
    ...
    my $diff = $ssB - $ssA;
    
    print "The diffence in seconds between $dateB and $dateA = $diff\n";
    
  2. or download this
    $ ./datediff.pl 
    dateA = 59:59:23:31:11:2002
    ...
    (00,00,00,01,00,2003)
    number of seconds from Jan 1st 1970 to midnight 2003 = 1041408000
    The diffence in seconds between 00:00:00:01:00:2003 and 59:59:23:31:11
    +:2002 = 1