Conversion of date to Julian date

Hi Gurus,

Need help in Conversion of date(2007-11-30) to Julian date(YYDDD)...

'+%J'

2007-11-30 to 'YYDDD'

Thanks

check out the FAQ article on this site....

http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html

you should find what you're after in there - this type of question comes up regulalrly enoiugh that searching the forums (or checking the above article) should be enough...

If you're still having problems, post your code/attempts and we'll see what we can do :wink:

Thanks ..

---------- Post updated at 09:30 PM ---------- Previous update was at 07:24 PM ----------

# your date
DATE="2007-11-30"

DATE=`echo $DATE | sed 's/-//g'`

date --date=$DATE '+%y%j'

throws an error

date: illegal option -- -
Usage: date [-u] [+format]
date [-u] [mmddhhmm[[cc]yy]]
date [-a [-]sss.fff]

install GNU date

$ date -d "2007-11-30" +%j
334

is there any other way

to get the date(2007-11-30) to Julian date(YYDDD)...