Skip to content

datetimeindex returns wrong datetimes with tolist() and values() #1437

Closed
@saroele

Description

@saroele

In [82]: dr = pandas.date_range(start='2012-01-01', periods=10, freq='30Min')

In [83]: dr
Out[83]:
<class 'pandas.tseries.index.DatetimeIndex'>
[2012-01-01 00:00:00, ..., 2012-01-01 04:30:00]
Length: 10, Freq: 30T, Timezone: None

In [84]: dr.values
Out[84]:
array([1970-01-16 224:00:00, 1970-01-16 224:30:00, 1970-01-16 225:00:00,
1970-01-16 225:30:00, 1970-01-16 226:00:00, 1970-01-16 226:30:00,
1970-01-16 227:00:00, 1970-01-16 227:30:00, 1970-01-16 228:00:00,
1970-01-16 228:30:00], dtype=datetime64[ns])

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