1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
def is_leapyear_julian(x):
return x % 4 == 0
def days_in_year_julian(x):
if x % 4 == 0:
return 366
else:
return 365
J = 0
k = 0
def julian_to_counter(x, y, z):
for i in range(0, x, 1):
j = j + days_in_year_julian(i)
return j
l = is_leapyear_julian(x)
for i in range(0, y, 1):
k = k + days_in_month(i, l)
return k
return j + k + z - 2
print(julian_to_counter(2, 2, 2))