Help for this page

Select Code to Download


  1. or download this
    use Time::Local;  # module comes with Perl, so don't worry
    my $start = timelocal(0, 0, 0, 9, 1, 2004);
    printf "Days since Feb 9: %d days\n", int((time - $start)/(24*60*60));
    
  2. or download this
    use Time::Local;  # module comes with Perl, so don't worry
    my $start = timegm(0, 0, 0, 9, 1, 2004);
    printf "Days since Feb 9: %d days\n", int((timegm(localtime) - $start)
    +/(24*60*60));