Skip to content

Passing a POSIXct to a polars DataFrame can change some components? #1361

@etiennebacher

Description

@etiennebacher

I don't remember if this is known or not, and I don't have much experience with POSIXct. @eitsupi is this a bug?

date <- as.POSIXct("2493-05-15 00:00:00 CEST")

data.frame(x1 = date)
#>           x1
#> 1 2493-05-15  <<<<<<<<<<<<<< day is 15
polars::pl$DataFrame(x1 = date)
#> shape: (1, 1)
#> ┌─────────────────────┐
#> │ x1                  │
#> │ ---                 │
#> │ datetime[ms]        │
#> ╞═════════════════════╡
#> │ 2493-05-14 23:00:00 │ <<<<<<<<<<<<<< day is 14
#> └─────────────────────┘
neopolars::pl$DataFrame(x1 = date)
#> shape: (1, 1)
#> ┌─────────────────────┐
#> │ x1                  │
#> │ ---                 │
#> │ datetime[ms]        │
#> ╞═════════════════════╡
#> │ 2493-05-14 23:00:00 │ <<<<<<<<<<<<<< day is 14
#> └─────────────────────┘

Noticed in etiennebacher/tidypolars#170 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions