Skip to content

decimal_date doesn't handle daylight savings time boundaries. #450

@jasonelaw

Description

@jasonelaw

The decimal_date function doesn't seem to handle daylight savings time boundaries correctly.

> date4 <- ymd_hms("2016-03-13 01:00:00", tz = 'America/New_York')
> date4        <- date4 + dhours(-1:1)
> decimal4     <- decimal_date(date4)
> diff(decimal4)
[1] 0.0001138434 0.0002276867

The times above are a fixed hour apart however the decimal_date function ignores the tz information. Not sure this is intentional but it doesn't seem necessary unless I'm missing something.

I've fixed the issue in my fork and and wrote a couple tests. All tests in test-decimal-date passed. I'll issue a pull request shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions