Skip to content

changing hour, minute or second of date should yield POSIXct #831

@keesdeschepper

Description

@keesdeschepper

See #732 (comment).
Changing hour, minute or second of date now yields POSIXlt:

class(as_date(0) + hours(1))
#> "POSIXlt" "POSIXt" 

POSIXct is the preferred class for datetimes, though (cf. as_datetime). Moreover, POSIXlt does not allow for infinity, leading to bugs like:

as.numeric(as_date(c(0, Inf)))
#> 0 Inf
as.numeric(as_date(c(0, Inf)) + hours(1))
#> 3600   NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions