Subj : How to compute date To : comp.os.linux From : michael1cat Date : Sat Aug 14 2004 11:31 pm avsrk@mailcity.com (Subrahmanyam Arya) wrote in message news:<25c1993e.0408111114.69eabd33@posting.google.com>... > Given the current date and the number of days we want to go backwards > or forwards , how do we compute the date (i.e day , month , year ) of > the new date . What is the easy way is there any os call , which does > that or do we need to write out own function . Any code snippets are > appreciated . $ date -I 2004-08-14 $ date -I -d '+10 days' 2004-08-24 $ date -I -d '-10 days' 2004-08-04 $ date -I -d '-100 days' 2004-05-06 $ date -I -d '+100 days' 2004-11-22 $ date -I -d '+3000 days' 2012-10-31 $ date -I -d '-3000 days' 1996-05-28 $ http://www.gnu.org/software/coreutils/manual/html_chapter/coreutils_21.html#SEC133 .