This is probably an easy fix, but it escapes me.
code:
D=date %Y-%m-%d
D1=`date +%s -d "$D"`
D2=`date +%s -d "2017-01-20"`
((diff_sec=D2-D1))
echo - | awk -v SECS=$diff_sec '{printf "Number of days : %d",SECS/(60*60*24)}'0
echo ""
runtime:
$ ./datediff.sh
./datediff.sh: line 1: fg: no job control
Number of days : 656
$
eek.. ./datediff.sh: line 1: fg: no job control