I'm trying to write a program in which the user enters a calendar date such as 2011 06 20 11 04 45 (YYYY MM DD hh mm ss), and gets back a Julian date such as 2455732.961632 (I test results with the conversion tool at http://aa.usno.navy.mil/data/docs/JulianDate.php
). The day occasionally strays, from 1 day to around maybe 50 days off, with no discernible pattern, at least not chronologically. The time, the numbers after the decimal, is always correct. I was wondering if anyone knew of some vague equation I've forgotten. I've already written the code for leap years, the different amounts of days in each month, the absence of a year 0, etc. Is there anything I may be missing, or something that I'm likely to have miscalculated?
Any help would be appreciated.