Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

julian date conversion

161 views
Skip to first unread message

Super-User

unread,
Jul 8, 2002, 12:06:17 PM7/8/02
to
Is there a way to convert a date from MMDDYY format to julian date
format in Solaris?

Keith Thompson

unread,
Jul 9, 2002, 8:47:27 PM7/9/02
to
Super-User <rits...@att.com> writes:
> Is there a way to convert a date from MMDDYY format to julian date
> format in Solaris?

I'm sure there are a number of ways -- but first, what do you mean by
"julian date format"? That term, or something similar, is often
incorrectly used to refer to the day of the year (for example, today
is day 190 of the year 2002).

You probably aren't referring to the Julian calendar, the predecessor
to the modern Gregorian calendar; it hasn't been used in most of the
world for several centuries.

There's also a "Julian day number" (named after used by astronomers;
it's the number of days since January 1, 4713 B.C.

--
Keith Thompson (The_Other_Keith) k...@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"

Chris Thompson

unread,
Jul 10, 2002, 3:21:48 PM7/10/02
to
In article <yecy9ck...@king.cts.com>, Keith Thompson <k...@cts.com> wrote:
>Super-User <rits...@att.com> writes:
>> Is there a way to convert a date from MMDDYY format to julian date
>> format in Solaris?
>
>I'm sure there are a number of ways -- but first, what do you mean by
>"julian date format"? That term, or something similar, is often
>incorrectly used to refer to the day of the year (for example, today
>is day 190 of the year 2002).
>
>You probably aren't referring to the Julian calendar, the predecessor
>to the modern Gregorian calendar; it hasn't been used in most of the
>world for several centuries.
>
>There's also a "Julian day number" (named after used by astronomers;
>it's the number of days since January 1, 4713 B.C.
^^^^^^^^^^^^^^^^^^^^

In the [proleptic] Julian calendar [q.v. above], of course ... :)

Chris Thompson
Email: cet1 [at] cam.ac.uk

John Claxton

unread,
Jul 20, 2002, 9:59:33 PM7/20/02
to
I believe GNU's date will do this:

$ date --date="2-FEB-2002" "+%j"
033

Don't have time to check if its available for Solaris, but there is
always
the source. :-)

John Claxton
Network Essentials Inc
Home of "Get Certified!" with over 1,000 sample Solaris certification
questions

"Super-User" <rits...@att.com> wrote in message
news:3D29B879...@att.com

> Is there a way to convert a date from MMDDYY format to julian date
> format in Solaris?


--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

George Martin

unread,
Jul 21, 2002, 1:40:21 PM7/21/02
to
John Claxton wrote:
> I believe GNU's date will do this:
>
> $ date --date="2-FEB-2002" "+%j"
> 033
>
> Don't have time to check if its available for Solaris, but there is
> always
> the source. :-)
>
> John Claxton
> Network Essentials Inc
> Home of "Get Certified!" with over 1,000 sample Solaris certification
> questions
>
> "Super-User" <rits...@att.com> wrote in message
> news:3D29B879...@att.com
>
>
>>Is there a way to convert a date from MMDDYY format to julian date
>>format in Solaris?
>
>
>
>
>

On the off chance that the original poster was asking for
the true Julian Date, that is the one used in Astronomy which
is a continuous count of days from the year -4712, here is
the algorithim from Jean Meeus' _Astronomical Algorithms._

Let Y be the year (year 1 B.C = -1, etc.)
Let M be the month number (January = 1, etc.)
Let D be the day of the month. The time of day
can be expressed as a fraction of a day.

If M > 2 leave Y and M unchanged.
Otherwise Set Y = Y -1, M = M + 12

Let A = INT(Y/100)
If Y is from the Gregorian calendar
Let B = 2 - A + INT(A/4)
Else (Y is from the Julian calendar)
Let B = 0

Then:
JD = INT(365.25*(Y + 4716)) + INT(30.6001*(M + 1))
+ D + B - 1524.5

Note that the Julian Day starts at 12 hours UT!

(INT is Meeus' notation for the integer portion of
a number.)

By the way, the Julian in Julian Date is not Julius
Caesar of the Julian calendar.

From Google:

http://aa.usno.navy.mil/data/docs/JulianDate.html

provides a Julian Date web based calculator, and

wwwmacho.mcmaster.ca/JAVA/CD.html

computes the calendar date from the Julian Date.
See also:

tycho.usno.navy.mil/mjd.html
scienceworld.wolfram.com/astronomy/JulianDate.html

(and many more of course via Google.)

Hope this helps,

George Martin

0 new messages