Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

how to convert given date to julian date

mm:DD:YYYY

string sGivenDate = "07302010";

Thanks
Chaegie
Posted

You really mean Julian Dates???

You want to convert a US Date format into the Julian Calendar?

(Remembering that Julian Dates were always dd/mm/yy as the US didn't exists back then)

Firstly, ask which country you need it to be supplied for, for the Julian calendar was subject to regional variations.
eg it was dropped firstly in the Vatican on 24th February 1582, but Spain and Portugal kept it until 4th October that year.
Denmark and Norway kept it until 1st March 1700, and the UK did not get rid of it until 2nd September 1752, causing riots as people thought they had lost 11 days!

Any way, once you have worked out which country, take the date and drop 11 days off it,(ensuring the result is still within the Julian Era for that country, if it is Gregorian, do not take the 11 days off) and convert from MM/DD/YY to DD/MM/YY and you will have the Julian Calendar.

It is a REALLY hard job you are doing there.

I think in all the adoption of Gregorian Calendar from Julian took nearly 200 years and there were over 50 adoption dates and reversals.
 
Share this answer
 
v5
Comments
Marcus_2 6-Jul-10 6:56am    
We swedes had a funny way to solve it (in the end it wasnt used), from 1700 we would skip the 29 februari on leap years which meant it would be finished 1740. So we did that 1700, 1704 and 1708 we forgot about it and had the 29'th of February which messed up the plans and the calender weren't in sync with anyone else's...
So 1712 we inserted two leap days ending up with both 29'th and 30'th of February.

1753 we made another attempt, then we went from 17't February to 1 of march and problem solved.
Jörgen Andersson 6-Jul-10 7:20am    
Except that it isn't 11 days off anymore. Now it's 13 days off nowadays, as both the years 1800 and 1900 weren't leap years in the Gregorian calendar
If you google/bing/yahoo for c# convert date to julian date you will find lots and lots of useful links. Most of them have code.
 
Share this answer
 
Which date do you want : http://en.wikipedia.org/wiki/Julian_day[^]
Anyway, it should be straightforward to calculate it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900