Year = Year - 1
Year = Year - MinYear
- return (((Year / 100)*146097) / 4) + (((Year % 100)*1461) / 4) + (((153*Month)+2) / 5)+Day+First2Months
+ return (((Year // 100)*146097) // 4) + (((Year % 100)*1461) // 4) + (((153*Month)+2) // 5)+Day+First2Months
def DateToDMY(Julian):
Day = Julian-30
else:
I = (4*(Julian-First2Months))-1
- J = (4*((I % 146097) / 4))+3
- Year = (100*(I / 146097))+(J / 1461)
- I = (5*(((J % 1461)+4) / 4))-3
- Month = I / 153
- Day = ((I % 153)+5) / 5
+ J = (4*((I % 146097) // 4))+3
+ Year = (100*(I // 146097))+(J // 1461)
+ I = (5*(((J % 1461)+4) // 4))-3
+ Month = I // 153
+ Day = ((I % 153)+5) // 5
if Month < 10:
Month = Month + 3
else:
Day = 28
Year = Year + Years
- Year = Year + Months / 12
+ Year = Year + Months // 12
Month = Month + Months % 12
if Month < 1:
Month = Month + 12
Day = 28
Year = Year + Years
- Year = Year + Months / 12
+ Year = Year + Months // 12
Month = Month + Months % 12
if Month < 1:
Month = Month + 12
return 0, 0, 0
else:
- Hours = T / SecondsInHour
+ Hours = T // SecondsInHour
T = T - Hours*SecondsInHour
- Minutes = T / SecondsInMinute
+ Minutes = T // SecondsInMinute
T = T - Minutes*SecondsInMinute
Seconds = T
Seconds = 0
if not Truncate:
- if Minutes >= (MinutesInHour / 2):
+ if Minutes >= (MinutesInHour // 2):
Hours = Hours + 1
Minutes = 0
Hours, Minutes, Seconds = TimeToHMS(T)
if not Truncate:
- if Seconds >= (SecondsInMinute / 2):
+ if Seconds >= (SecondsInMinute // 2):
Minutes = Minutes + 1
Seconds = 0
Secs = -Secs
# adjust the date
- DT2[0] = DT2[0] - Secs / SecondsInDay
+ DT2[0] = DT2[0] - Secs // SecondsInDay
Secs = Secs % SecondsInDay
if Secs > DT2[1]:
DT2[1] = DT2[1] + Secs
# adjust date if necessary
- DT2[0] = DT2[0] + DT2[1] / SecondsInDay
+ DT2[0] = DT2[0] + DT2[1] // SecondsInDay
# force time to 0..SecondsInDay-1 range
DT2[1] = DT2[1] % SecondsInDay