I am writing a library and I don't want to require pytz since the library itself doesn't know or care about timezones (it's reading and writing data in the form of Unix timestamps, which don't have any timezone information associated with them). I always return new timestamps as aware datetimes using dt.timezone.utc
(i.e. something like dt.datetime(..., tzinfo=dt.timezone.utc)
).
Will these timestamps interact sensibly (e.g. datetime subtraction produces correct results) with pytz timestamps like those you get from pytz.localize(...)
, or do I need to use pytz.utc
instead?