tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
731 stars 207 forks source link

with_tz only returns the date in certan situations #1075

Closed u1642 closed 2 years ago

u1642 commented 2 years ago

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/ or https://community.rstudio.com/.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.

Brief description of the problem When I run with_tz I will in certan situations only get the date , not the time output

with_tz(as.POSIXlt("2022-09-03 21:59:59 UTC", tz = "UTC")) [1] "2022-09-03 23:59:59 CEST" > with_tz(as.POSIXlt("2022-09-03 22:00:00 UTC", tz = "UTC")) [1] "2022-09-04 CEST" with_tz(as.POSIXlt("2022-09-03 22:00:01 UTC", tz = "UTC")) [1] "2022-09-04 00:00:01 CEST"

Best regards Henrik Johansen

# insert reprex here
with_tz(as.POSIXlt("2022-09-03 21:59:59 UTC", tz = "UTC"))
with_tz(as.POSIXlt("2022-09-03 22:00:00 UTC", tz = "UTC"))
with_tz(as.POSIXlt("2022-09-03 22:00:01 UTC", tz = "UTC"))
u1642 commented 2 years ago

its not a lubridate problem