PY: Fixed calendar/time conversion functions for extreme year values.

Applying the same recent fixes to C and C# to the Python code.

I'm also changing my philosophy of representing times.
From now on, they will be truncated to the floor millisecond,
not rounded to the nearest millisecond. This means we don't reach
another calendar date until we have had 60 full seconds after
the last minute. Otherwise there is too much nasty logic for
rounding up calendar dates. I will follow suit across all languages.
This commit is contained in:
Don Cross
2023-02-25 22:37:58 -05:00
parent e7d48c6ea7
commit 503538da12
12 changed files with 242 additions and 217 deletions

View File

@@ -947,6 +947,16 @@ The value of the calling object is not modified. This function creates a brand n
**Returns**: [`Time`](#Time)
<a name="Time.Calendar"></a>
### Time.Calendar(self) &#8594; Tuple\[int, int, int, int, int, float\]
**Returns a tuple of the form (year, month, day, hour, minute, second).**
This is a convenience method for converting a `Time` value into
its Gregorian calendar date/time representation.
Unlike the built-in `datetime` class, this method can represent
dates over a nearly 2 million year range: the years -999999 to +999999.
<a name="Time.FromTerrestrialTime"></a>
### Time.FromTerrestrialTime(tt: float) &#8594; [`Time`](#Time)