Shell: November 2010 Archives

Date calculate in script

user-pic
Vote 0 Votes

100 days after 2010-11-30
# date +%Y-%m-%d -d "2010-11-30 100 day"
2011-03-10

100 days before 2010-11-30
# date +%Y-%m-%d -d "2010-11-30 -100 day"
2010-08-22

How many days between 2010-06-01 and 2010-11-30 (in same year)
# echo $[`date +%j -d 2010-11-30`-`date +%j -d 2010-06-01`]
182

How many days between 2010-11-30 and 2012-12-22 (in different year)
# echo $[(`date +%s -d 2012-12-22`-`date +%s -d 2010-11-30`)/86400]
753

About this Archive

This page is an archive of entries in the Shell category from November 2010.

Shell: October 2010 is the previous archive.

Shell: January 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives