date tutorial

Modeling Times and Dates

GNU Utils

Julian -> Gregorian

year=2006
jday=213
date -d "${year}-01-01 +$((${jday} - 1 ))days" +%Y-%m-%d

Gregorian -> Julian

date -d "2006-08-01" +%Y%j

A different day

date -d "2006-08-01 +1day" +%Y%j
date -d "2006-08-01 +1month" +%Y%j
date -d "2006-08-01 +1year" +%Y%j
date -d "2006-08-01 +1hour" +%Y%j
date -d "2006-08-01 +1second" +%Y%j
date -d "2006-08-01 -1day"
date -d "2006-08-01 -1month"
date -d "2006-08-01 -1year"
date -d "2006-08-01 -1hour"
date -d "2006-08-01 -1second"

Some problems

date -d "2006-03-31 -1month"

With IOAPI

Julian -> Gregorian

gregdate 2006213

Gregorian -> Julian

juldate 20060801