예제 #1
0
 def test_round_trip_from_date_compare_vanilla_dates(self, dt):
     vd = dt.date()
     (y, m, d) = (vd.year, vd.month, vd.day)
     jdn = julian_to_julian_day_number(y, m, d)
     result = julian_day_number_to_julian(jdn)
     self.assertEqual(vd, vanilla_date(*result))
예제 #2
0
 def test_number_to_julian_date(self):
     self.assertEqual(julian_day_number_to_julian(0), (-4713, 1, 1))
     self.assertEqual(julian_day_number_to_julian(365), (-4712, 1, 1))
     self.assertEqual(julian_day_number_to_julian(5373481), (9999, 10, 19))
     self.assertEqual(julian_day_number_to_julian(5373524), (9999, 12, 1))