As per ?timezones
, invalid timezones are treated as UTC
often without a warning. It's likely that your specific environment doesn't know how to interpret "America/Chicago". The documentation points out that it's inconsistent.
Try using "CDT"
instead of "America/Chicago". Alternatively, there are details in ?timezones
about how to feed R a list of timezone formats to interpret.
UPDATE: as.Date
returns a "date" object, not a character string. as.POSIXlt
will, quote: "Dates without times are treated as being at midnight UTC", from as.POSIXlt
. So it seems if x
is a date
object in as.POSIXlt
and it has no time value, the tz
option is ignored and replaced with UTC
.
As a result, another option is to ensure that the date
object passed to as.POSIXlt
has time & timezone already specified. Or, convert the object to character string before passing it to as.POSIXlt
so that it will use its own tz
option.