I live in Sydney and use a database that often stores dates as POSIXcts.
as.Date is frequently used, but to get correct values, it has to be as.Date(x, tz = "My/Timezone")
.
Is there a way to change this behaviour?
I've attempted creating the function
as.Date <- function(x, ...){zoo::as.Date(x, ..., tz = "Australia/Sydney")}
but this doesn't work well with the implementation of as.Date
that targets numeric entries or unusual date formats (e.g. as.Date("01/01/2000", "%d/%m/%Y")
would break as the default first argument is tz
which is not a format).
Is there a fix?
I've seen this: How to change the default time zone in R? but it seems to address a different issue: my timezone is correct, but the as.Date function doesn't care about my timezone.