Skip to content

Timestamp.fromordinal Exception AttributeError #3042

@michaelaye

Description

@michaelaye

I have a datetime.datetime, convert it to ordinal and try to read it back with pd.Timestamp.fromordinal(). This produces the following error:

In [112]: dt
Out[112]: datetime.datetime(2011, 4, 16, 0, 0)

In [113]: pd.Timestamp.fromordinal(dt.toordinal())
Exception AttributeError: "'int' object has no attribute 'utcoffset'" in 'pandas.tslib._localize_tso' ignored
Out[113]: <Timestamp: 1970-01-01 00:00:00.000002011>

Am I expecting something wrong by thinking this should work or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions