Closed
Description
ATM pd.Timestamp.utcnow()
returns a UTC-localized Timestamp
object, but pd.Timestamp.utcfromtimestamp()
does not. As a result, the following round-trip fails:
unow = pd.Timestamp.utcnow()
result = pd.Timestamp.utcfromtimestamp(unow.timestamp())
assert unow == result # <-- TypeError because unow is tzaware and result is tznaive
Changing this would mean breaking with the stdlib, but our utcnow
already breaks with the stdlib (see also #22450)