Julian date from calender date
is there any simple command in ksh (not big programme) from which I can obtain julian date from calender date of format YYYY-MM-DD
|
Does this work for you?
Code:
date -d '2007-04-01' +'%Y %j' |
|
sorry removed the post... would like to do some homework prior to that.
|
Quote:
"man -k julian" returns nothing |
The above command is wroking on linux but not on unix. I am trying to go through the manual pages for 'date' command, so far unable to get the same result on unix system.
|
Quote:
My output: Code:
[mherring@localhost ~]$ date -d '2007-04-01' +'%Y %j' |
I want the same output which you are getting. the year and the number of days.
|
Hi.
The accepted and precise meanings of the term may be a sub-issue here. Quote:
|
Not able to figure out how do get it on Unix system.
equivalent of following command in linux Code:
date -d '2007-04-01' +'%Y %j' |
Quote:
Google any help? |
date command exists on unix server. Not able to figure out, how to convert into julian date.
Trying google as well, so far no luck, may be soon. :( |
Hi.
There is a perl version of date at: http://search.cpan.org/src/CWEST/ppt...ate/index.html -- the perl Power Tools collection. Running it to get what some call the Julian date produces: Code:
% ./date.jgross "+%j" |
Need it through ksh or bash.
|
Hi.
Ah. There is a collection of cfaj's scripts at http://members.torfree.net/chris/books/cfaj/ssr.html In Chapter 8 he has a number of functions for date manipulation. Some appear to deal with "Julian". I have not tried them. There are several algorithms in pseudo-code that IBM published just before Y2K. I have listed the contents below. If you really cannot find anything else, I can post the algorithms. IBM seems to have archived them -- I cannot find them on their web page http://www.software.ibm.com/year2000/tips15.html -- perhaps you would have better luck than I did -- or perhaps you can Google for them. You would need to translate those into shell scripts. I did a few in perl just to check them out. Finally, sourceforge has a number of codes for Julian, but they appear to be the real Julian date forms. Best wishes ... cheers, makyo Quote:
|
All times are GMT -5. The time now is 03:19 AM. |