Weird date difference problem

Yay!

Yes, you are correct about it comparing it to midnight.

Feel free to ask questions. You should pretty much be able to use the Python script as a framework and replace each line with Perl. I would do it myself, but today is a busier day at work than yesterday was.

I'm still bummed that you don't have Python, though. It's so much nicer to work with than Perl -- especially for a beginner. Perl rocks for the super-dense one-liners and regex-intensive short scripts, but Python is cleaner and easier to learn.

ShawnMilo

Hey Shawn,
Finally managed to write the perl script to calculate the difference in days.

use Time::Local;
use POSIX;

$mm="$ARGV[0]";
$dd="$ARGV[1]";
$yyyy="$ARGV[2]";

$fileDate = timelocal(0, 0, 0, $dd, $mm, $yyyy); 

$now = time(); 
$diff = ($now - $fileDate) / (24*60*60); 
#print "difference in days is  ", int( $diff ) ,"\n";
print int($diff);

and then I am calling this perl script from my program to get the day difference.
Thanks again for all your help.

Excellent! Glad to help. Perl is the glue that holds the Internet together, after all. It's not surprising that you were able to use it to solve this problem. Happy Wednesday.

Shawn