Skip to content

Timestamp.to_datetime() crashes with win32timezone.TimeZoneInfo objects #10459

@mcg1969

Description

@mcg1969

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandasTimezonesTimezone data dtypeWindowsWindows OS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions