Closed miracle2k closed 6 years ago
Thanks for catching this bug!
This bug was introduced when making Pandas an optional dependency (#9). My stance is that naive datetimes should be assumed to be in UTC. See this note on the documentation. Now the behavior is consistent with how it was on >0.2.0, independent of whether or not Pandas is available.
Further reference:
New release (v0.3.1) including this fix.
Given the datetime
datetime.datetime(2018, 4, 27, 20, 26, 38, 456123)
.Before 65f986243cea98072da42f510905fddc116bc775, this resulted in a timestamp of
1524860798456123000
being sent (pd.Timestamp(x).value
).After, it results in
1524857198456123000
being sent (int(x.timestamp()) * 10 ** 9 + x.microsecond * 1000
).The first one interprets the time as UTC. The second one one interprets it as local time.
Not sure which one you prefer, just wanted to point out this (backwards-incompatible) change.