There is always confusion between a
Julian Day[
^]
Quote:
the continuous count of days since the beginning of the Julian Period
and the
Julian Calendar[
^] which is essentially a civil calendar which represents dates as year, month, day. For the latter purpose you can use the System.Globalization.JulianCalendar class but not the former. Brittanica gives a nice terse explanation of
Julian Period[
^]
The Wikipedia link given in Solution 1 and repeated above gives the correct calculation method for a Julian Day. There is a C# representation of that calculation presented on this
post[
^], however the first of your methods appears to be reasonably accurate.
For testing I prefer the US Naval Observatory
website[
^] as it caters for a Julian Day beginning at mid-day (i.e. correctly displays the decimal part based on time of day)
Your second method is calculating a quasi-julian day (note the lower case) based on number of days since 01-Jan-2000, which is common enough use in some application areas, for example where there are constraints on variable size. It would not be an appropriate method to use for (for example) Astronomy or Financial services (especially Pensions). The last time I used that approach was on a Dairy Management system on CP/M back in the early 80's where (apart from limited memory) our constraint was the birth year of the oldest known dairy cow in the world!