Skip to content

BUG: to_datetime with unit, utc=True and errors='ignore' does not coerce to UTC #23758

Closed
@mroeschke

Description

@mroeschke
In [3]: pd.__version__
Out[3]: '0.24.0.dev0+1040.g24bce1a5f'

In [4]: pd.to_datetime([1], unit='s', box=True, utc=True, errors='ignore')
Out[4]: DatetimeIndex(['1970-01-01 00:00:01'], dtype='datetime64[ns]', freq=None)

It appears the tz argument is missing from the output here:

return Index(result, name=name)

Expected Output

In [4]: pd.to_datetime([1], unit='s', box=True, utc=True, errors='ignore')
Out[4]: DatetimeIndex(['1970-01-01 00:00:01+00:00'], dtype='datetime64[ns, UTC]', freq=None)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions