BUG: to_datetime ignores utc=True when arg is Series · Issue #6415 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@michaelaye

Description

@michaelaye

Is this a bug or a feature that I don't understand:

data = ['20100102 121314', '20100102 121315'] print (pd.to_datetime(data, format='%Y%m%d %H%M%S', utc=True)[0]).repr() print (pd.to_datetime(pd.Series(data), format='%Y%m%d %H%M%S', utc=True)[0]).repr() print (pd.to_datetime(pd.TimeSeries(data), format='%Y%m%d %H%M%S', utc=True)[0]).repr()

results in

Timestamp('2010-01-02 12:13:14+0000', tz='UTC') Timestamp('2010-01-02 12:13:14', tz=None) Timestamp('2010-01-02 12:13:14', tz=None)

Using version '0.13.1'


Other example in #15760