Skip to content

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

Closed

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.

Activity

  1. added a commit that references this issue on Aug 3, 2016
    07f8553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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