Actually my script has problems, it overflows much earlier than it should be. Here's an updated one:
#!/bin/sh
s1=`date -d $1 +%s`
s2=`date -d $2 +%s`
day1=$(($s1/3600/24))
day2=$(($s2/3600/24))
echo "Days: " $(($day2 - $day1))
But like I said it can only calculate from 1902 - 2038. I'll try to come up one with awk (why I didn't think of that? stupid me) if I have time. But I have to deal with leap year myself I guess.
#!/bin/sh
s1=`date -d $1 +%s`
s2=`date -d $2 +%s`
day1=$(($s1/3600/24))
day2=$(($s2/3600/24))
echo "Days: " $(($day2 - $day1))
But like I said it can only calculate from 1902 - 2038. I'll try to come up one with awk (why I didn't think of that? stupid me) if I have time. But I have to deal with leap year myself I guess.