Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 212011
 

Simple date calculation using date command

Answer:

Date command is useful to calculate date, e.g. Assume today is 2011-01-15

1. Find a date in the past, e.g. 60 days ago

# date --date='60 days ago' "+%Y-%m-%d"
2010-11-16

2. Find a date in the future, e.g. 60 days in the future

# date --date='60 days' "+%Y-%m-%d"
2011-03-16

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>