Date manipulation using GNU date

GNU date command lets you do just about everything related to date and time but date manipulation is something not well documented.

# get date 2 weeks from now
date –date “now 2 week”

# 2 months earlier
date –date “now -2 month”

you can give any date in place of ‘now’ or use a variable.

# what day is it after 10 days?
date –date “now 10 day” +%A

Leave a Reply