Linux - NewbieThis forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
There is only ONE Julian Day (aka Julian Date). The day-of-year thing is bullshit (although, unfortunately, very commonly accepted bullshit) - that is NOT a Julian date - that is what some ignoramuses (ignorami?) from the management world called the day-of-year (Ordinal Day of Year, as accepted in the ISO terminology), so parroting that is promoting ignorance and confusion as to what a Julian date is.
The US Naval Observatory also has other useful web pages discussing time, but I can't seem to find them at the moment. Just to confuse things, some of the positive dates in the Julian Date system actually preceed the use of the Julian Calendar, and these are known as the Proleptic Julian Dates. In a similar fashion, dates written as a Gregorian Date but before the establishment of the Gregorian Calendar (such as dates typically quoted in history books) are proleptic Gregorian dates.
So if you really want Julian Dates, you need to read a bit about the history of time and look up conversions. If you can get a copy of a current edition of the Royal Astronomical Almanac, you may find a simple calculation of the Julian Date referenced to a more recent epoch; if you want something more accurate (not made obsolete in the near future or past) you will need to do a lot more reading.
Easy Tiger, I was just pointing out his options. That also includes the Wiki page which points out various 'definitions' of such 'dates' and the history thereof, inc links to eg USN Observatory.
You don't know which one he actually wants.
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 246
Thanked: 1
You know the old poem:
30 days hath September, April, June and November,
All the other days but February have 31,
February has 28 unless its a leap year.
Build these datas into an array.
Its possible to so given an year, you determine whether its a leap year or not.
Then offset days for the elapsed months, (Jan 0, Feb 31 ..)
Add days in the current month.
There is the same example in K&R (in C).
It can be easily written in any other programming language and also in shell script also.
Even big technology players like IBM refer to ordinal dates as 'julian date format'. YY.DDD was a very common format on their MVS mainframes and probably still is. It's a little harsh to call it 'bullshit'. It's actually a very useful date format. Far more useful than the number of days from some ancient epoch for most uses, unless you're doing something with astronomical data when an ancient epoch is probably quite vital.
I think its a pretty safe bet what he's looking for is the more commonly (if incorrectly) used meaning,
date +%Y-%j is most likely the correct answer in this case.
Anyway, could be worse, if it was based on the Chinese year then today would be
"Rat-216"
Off topic, I know, but I cannot resist.
ignoramus = "we know not", sometimes "we do not want to know".
There is no Latin plural of ignoramus; it is a (non-nominal) form of a verb and it is not the same -us as in fungus.
Your "ignoramuses" is right.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.