Closed zapper44 closed 2 years ago
This behavior is to agree with how almanacs display time: if an almanac shows only minutes, then it's rounding to the nearest minute using the seconds. The documentation for the method you're calling —
https://rhodesmill.org/skyfield/api-time.html#skyfield.timelib.Time.utc_strftime
— describes the behavior down at the bottom:
If the smallest time unit in your format is minutes or seconds, then the time is rounded to the nearest minute or second. Otherwise the value is truncated rather than rounded.
I'll bet that I need to move that info up so that people can find it. I'll see about putting the word "round" in the first line somewhere.
Oh, I'm such a noob when it comes to converting timestamps and understanding how this all fits together, haha.. Thanks for holding my hand here and pointing me to my misinterpretation. I also think I got the 'zero-based' title somewhat wrong but at least you instantly knew what I was talking about.
Back to reading the API page a bit more.. ;-)
Does timescale use zero-based minutes whereas the other units do not?
Python 3.7.3 Skyfield v1.39
For example:
Generates the following output:
Notice how only minutes is zero based, whereas seconds and hours is not.
Is this a feature or a bug?