Currently, pyisy.helpers.now() and ntp_to_system_time() return naive datetimes, often reflecting the local system clock. As part of modernizing the library to Python 3.11+ standards, we should transition these to return UTC-aware datetimes using datetime.UTC.
Considerations:
- This is a breaking change for consumers that perform arithmetic with these values and expect naive objects.
- It will shift
last_changed, last_update, and last_edited values by the local UTC offset for consumers treating them as wall-clock time.
- A
CHANGELOG entry and potentially a major version bump (or a very clear migration path) will be required.
Proposed Change:
- Update
now() to use datetime.datetime.now(datetime.UTC).
- Update
ntp_to_system_time() to attach datetime.UTC.
Currently,
pyisy.helpers.now()andntp_to_system_time()return naive datetimes, often reflecting the local system clock. As part of modernizing the library to Python 3.11+ standards, we should transition these to return UTC-aware datetimes usingdatetime.UTC.Considerations:
last_changed,last_update, andlast_editedvalues by the local UTC offset for consumers treating them as wall-clock time.CHANGELOGentry and potentially a major version bump (or a very clear migration path) will be required.Proposed Change:
now()to usedatetime.datetime.now(datetime.UTC).ntp_to_system_time()to attachdatetime.UTC.