Skip to content

Timestamp unit is not respected #27490

Closed
Closed
@david-cortes

Description

@david-cortes

Timestamps always get returned in nanoseconds regardless of the unit I specify:

import numpy as np, pandas as pd
np.datetime64("2018-01-01").astype("datetime64[s]").astype(int)
>>> 1514764800
pd.Series(np.datetime64("2018-01-01")).astype("datetime64[s]")
0   2018-01-01
dtype: datetime64[ns]
pd.Series(np.datetime64("2018-01-01")).astype("datetime64[s]").astype(int)
0    1514764800000000000
dtype: int64

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDatetimeDatetime data dtypeError ReportingIncorrect or improved errors from pandasNon-Nanodatetime64/timedelta64 with non-nanosecond resolution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions