You can either write a script or a function passing the two dates as arguments. Example, if you define a function:
Code:
function datediff () {
echo $(( ($(date -ud "$2" +%s) - $(date -ud "$1" +%s)) / 86400 ))
}
then you can simply launch a command like this:
Code:
$ datediff 1-Jan-2003 7-Dec-2010
2897
The two dates must be in a standard format recognized by the date command. See
info date for details.