Created
April 12, 2021 21:12
-
-
Save DavisVaughan/cbedcd5bcfcf9fedeafc3b1c36cfc5a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x <- lubridate::today() | |
x | |
#> [1] "2021-04-12" | |
# not what i wanted... | |
# (treats the Date as UTC, then shows it to you in your local tz) | |
as.POSIXct(x) | |
#> [1] "2021-04-11 20:00:00 EDT" | |
# probably what you wanted: | |
lubridate::force_tz(x, "America/New_York") | |
#> [1] "2021-04-12 EDT" | |
lubridate::force_tz(x, "Europe/London") | |
#> [1] "2021-04-12 BST" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would also be a great time to try clock 😝
Created on 2021-04-12 by the reprex package (v1.0.0)