Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Julian Day
#11
(Oct-08-2016, 02:09 PM)sparkz_alot Wrote:
(Oct-08-2016, 04:11 AM)Skaperen Wrote:
(Oct-08-2016, 01:41 AM)sparkz_alot Wrote: I'm thinking the simple solution would be to take the absolute value of year, then its a matter of ignoring leap years for that time period. I'll have to give it a try over the weekend, perhaps.

don't forget that 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12 and 9 BC are leap years and 4 BC, 0, and 4 AD are not. then leap years are every 4 years until whatever year the transition from Julian to Gregorian was adopted where you are.  are you doing proleptic Gregorian?

what if i entered 1752 for the year, and 9 for September, and a date of 3.  would it reject that date?

i worked out another system that is even more accurate and also simpler, but they would never adopt it.  for it to work, it would have to be adopted before 2028.

now how can someone use this code in their GUI programs?

If you input the date, 1752-9-3 at 1200 hrs, you get a JD of 2361211.0, which jives with US Naval Observatory. As to the years prior to 1752 (though there appears to be some debate on this year) at least from year 8 AD a leap year was every 4 years...period. 
again though, this snag only applies to testing the user input, the formula itself (if given the correct information) is quite accurate.

Quote:i worked out another system that is even more accurate and also simpler, but they would never adopt it.  for it to work, it would have to be adopted before 2028.
 It would be interesting to see.  And you never know, the international committee has been known to adapt  :D

Quote:now how can someone use this code in their GUI programs?

Probably so, but not by me  :D  .

it accepted 1752, 9, 5 when i tried it and it gave a Julian day.  that date did not happen in the British empire (see https://en.wikipedia.org/wiki/1752). try "cal 1752" in a Linux shell and look at September. has this been tested with the BC leap years (e.g. 15 BC, 2, 29 should be valid)?  does it do leap years before 46 BC?  does it handle the varied start of a new year through history? calendar history is complex.  if the tool is applicable to history it too, would be complex.

how would the print calls work in a GUI environment?  will they pop up error windows?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.


Messages In This Thread
Julian Day - by sparkz_alot - Oct-06-2016, 03:39 PM
RE: Julian Day - by j.crater - Oct-06-2016, 06:15 PM
RE: Julian Day - by sparkz_alot - Oct-06-2016, 08:34 PM
RE: Julian Day - by j.crater - Oct-06-2016, 08:38 PM
RE: Julian Day - by Skaperen - Oct-07-2016, 04:17 AM
RE: Julian Day - by sparkz_alot - Oct-07-2016, 02:25 PM
RE: Julian Day - by Skaperen - Oct-08-2016, 01:05 AM
RE: Julian Day - by sparkz_alot - Oct-08-2016, 01:41 AM
RE: Julian Day - by Skaperen - Oct-08-2016, 04:11 AM
RE: Julian Day - by sparkz_alot - Oct-08-2016, 02:09 PM
RE: Julian Day - by Skaperen - Oct-09-2016, 02:27 AM
RE: Julian Day - by sparkz_alot - Oct-09-2016, 02:37 PM
RE: Julian Day - by Skaperen - Oct-10-2016, 02:27 AM
RE: Julian Day - by sparkz_alot - Oct-12-2016, 04:42 PM
RE: Julian Day - by Skaperen - Oct-13-2016, 03:32 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020