This wouldn't be backwards compatible, but I've seen many bugs due to using:
x <- as.POSIXct("2025-07-09 00:00:00", tz = "Europe/Zurich")
as.Date(x)
#> [1] "2025-07-08"
# instead of
as.Date(x, tz = attr(x, "tzone"))
#> [1] "2025-07-09"
# or use a date library instead
lubridate::as_date(x)
#> [1] "2025-07-09"
Created on 2025-07-09 with reprex v2.1.1
I would argue that in most cases the user would expect the default to be the latter.
This wouldn't be backwards compatible, but I've seen many bugs due to using:
Created on 2025-07-09 with reprex v2.1.1
I would argue that in most cases the user would expect the default to be the latter.