Thanks to the wonders of duck typing, pandas.Timestamp
happily accepts pywintypes.TimeType
objects (otherwise known as pywintypes.datetime
), including those that employ the win32timezone.TimeZoneInfo
object. And most methods work.
For some reason, to_datetime
does not, and indeed it crashes:
import pandas as pd
from win32timezone import TimeZoneInfo
from pywintypes import TimeType
x = TimeType(2012,12,1,0,0,tzinfo=TimeZoneInfo('GMT Standard TIme'))
y = pd.Timestamp(x)
print(y)
y.tzinfo
y.utcoffset()
y.to_datetime64()
y.to_datetime()
This occurs with Anaconda installed win64 Python 3.4.3 and Pandas 0.16.2.
I'm going to see if I can't dig down to find a key source of failure. Stay tuned
Comment From: jreback
as discussed. These are not supported at all (only pytz/dateutil)
. In fact getting dateutil
to work was quite some effort. Further windows may/may not follow the specifications. Probably simplest to raise NotImplementedError
for now. If someone wants to tackle this and try to make it work, would prob accept patches.
Comment From: mcg1969
Agreed on the NotImplementedError
.
Comment From: jbrockmendel
@mcg1969 can you confirm this still occurs on master?
Since I'm totally ignorant about Windows: does the "32" in "win32" imply that this problem will go away on its own if/when we stop supported 32bit builds?
Comment From: jreback
closing as stale, but pls open a new issue if recurring on modern pandas.