mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-19 14:27:52 -04:00
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:
@@ -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) → 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) → [`Time`](#Time)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user