Operating System - HP-UX
1833749 Members
2632 Online
110063 Solutions
New Discussion

Re: Date in Julian Format

 
SOLVED
Go to solution
Marcelo De Florio
Frequent Advisor

Date in Julian Format

Hown can i obtain the date in julian format ?
9 REPLIES 9
Bill McNAMARA_1
Honored Contributor

Re: Date in Julian Format

there are lots of args you can give to the date command to print out the date in a number of formats, text mm/dd/yy, dd/mm/yy, dd/month/yy..
but I have no idea what or who Julian is?
You may want to look at your locale settings.
Type in locale, and man locale and date for more.

Later,
Bill
It works for me (tm)
John Poff
Honored Contributor
Solution

Re: Date in Julian Format

If you like it in the format of YYDDD, try:

date +'%y%j'

If you prefer MMMMDDD, try:

date +'%Y%j'

James R. Ferguson
Acclaimed Contributor

Re: Date in Julian Format

Hi:

# date +%y%j

...returns 01152...

# date +%Y%j

...returns 2001152

...JRF...
MANOJ SRIVASTAVA
Honored Contributor

Re: Date in Julian Format

Hi Marcelo

use

date='date+%m+%d'

Manoj Srivastava
A. Clay Stephenson
Acclaimed Contributor

Re: Date in Julian Format

Hi Marcelo,

No guys, it's obvious that none of you are physicists or astronomer's (and possibly I'm both though one on a amateur basis) Julian dates are floating point number of days since approximately 0000hrs UCT Jan 1, 4712 B.C.E.
The fractional part represents the fractional part of the day to whatever precision.

Given that, Marcelo, yes, I've got routines to do this but I suspect that you want TRUNCATED julian dates (integer representations).

I suppose you want integer routines to convert year,month, and day to integer Julian equivalent (and possibly the inverse). If that's what you are looking for, let me know and I'll dig them up. It seems to me I coded the trucated versions in awk embedded in a shell script.

Regards, Clay

If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Date in Julian Format

Hello Clay:

On the contrary, I am aware of the nuance. I believe that there are some good articles from the US Naval Observatory sites on this. For some history, readers can take a look at this:

http://www.faqs.org/faqs/astronomy/faq/part3/section-6.html

For general, commercial computing, I have always seen "Julian" infer the notation of YYDDD.

With my regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Date in Julian Format

Hi James,

I suppose I'm too much of a purist to allow that; it's sort of like football coaches talking about momentum.

Regards, Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Date in Julian Format

Hi Clay:

Well put. I'm a big fan of Heisenberg, too. ;-)

Regards!

...JRF...
CHRIS_ANORUO
Honored Contributor

Re: Date in Julian Format

Hi Caesar's Senator,

Try DATE=`date +%A,%d:%m:%Y`

I know why you want this in Julian - Senator
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.