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
Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment