Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement xfirst and xlast to control for directional crossing of the DST gap. #23

Closed
vspinu opened this issue Dec 12, 2022 · 0 comments
Milestone

Comments

@vspinu
Copy link
Owner

vspinu commented Dec 12, 2022

library(timechange)
tt <- as.POSIXct(c("2014-11-02 00:15:00", "2014-11-02 02:15:00"), tz = "America/New_York")
time_add(tt, hours = c(1, -1), roll_dst = "pre")
#> [1] "2014-11-02 01:15:00 EDT" "2014-11-02 01:15:00 EDT"
time_add(tt, hours = c(1, -1), roll_dst = "post")
#> [1] "2014-11-02 01:15:00 EST" "2014-11-02 01:15:00 EST"
time_add(tt, hours = c(1, -1), roll_dst = "xfirst")
#> [1] "2014-11-02 01:15:00 EDT" "2014-11-02 01:15:00 EST"
time_add(tt, hours = c(1, -1), roll_dst = "xlast")
#> [1] "2014-11-02 01:15:00 EST" "2014-11-02 01:15:00 EDT"

Lubridate's issue tidyverse/lubridate#1088

@vspinu vspinu added this to the v0.2 milestone Dec 12, 2022
@vspinu vspinu closed this as completed in e7cf192 Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant