How to calculate two date difference in x days

Subtract two date difference in days
olddate=2018-06-19
newdate=2020-04-24
echo $(( ($(date -d $newdate +%s) - $(date -d $olddate +%s)) / 86400 )) days

Post a Comment

Mới hơn Cũ hơn