I am importing a simple timestamp file with the structure "%Y-%m-%d %H:%M:%S"
, i.e. "2014-10-26 04:15:32". A sample data set:
tz <- c("2014-10-26 00:27:14", "2014-10-26 00:42:14", "2014-10-26 00:57:14",
"2014-10-26 01:12:14", "2014-10-26 01:27:14", "2014-10-26 01:42:14",
"2014-10-26 01:57:14", "2014-10-26 02:00:32", "2014-10-26 02:12:14",
"2014-10-26 02:15:32", "2014-10-26 02:27:14", "2014-10-26 02:30:32",
"2014-10-26 02:42:14", "2014-10-26 02:45:32", "2014-10-26 02:57:14",
"2014-10-26 03:00:32", "2014-10-26 03:15:32", "2014-10-26 03:30:32",
"2014-10-26 03:45:32", "2014-10-26 04:00:32", "2014-10-26 04:15:32"
)
Afterwards, I use
tz <- as.POSIXct(tz, format="%Y-%m-%d %H:%M:%S")
without assigning any timezone. However, when I display tz
the output is the following:
[1] "2014-10-26 00:27:14 CEST" "2014-10-26 00:42:14 CEST" "2014-10-26 00:57:14 CEST" "2014-10-26 01:12:14 CEST"
[5] "2014-10-26 01:27:14 CEST" "2014-10-26 01:42:14 CEST" "2014-10-26 01:57:14 CEST" "2014-10-26 02:00:32 CEST"
[9] "2014-10-26 02:12:14 CEST" "2014-10-26 02:15:32 CEST" "2014-10-26 02:27:14 CEST" "2014-10-26 02:30:32 CET"
[13] "2014-10-26 02:42:14 CET" "2014-10-26 02:45:32 CET" "2014-10-26 02:57:14 CET" "2014-10-26 03:00:32 CET"
[17] "2014-10-26 03:15:32 CET" "2014-10-26 03:30:32 CET" "2014-10-26 03:45:32 CET" "2014-10-26 04:00:32 CET"
[21] "2014-10-26 04:15:32 CET"
Any ideas why R assigns two different time zones - CEST and CET?
I changed my local settings to Sys.setlocale("LC_ALL","English")
and I also used Sys.setenv(TZ='CET')
but without any result. I used different ways of conversion described Change timezone in a POSIXct object and http://blog.revolutionanalytics.com/2009/06/converting-time-zones.html but I am still not able to change the timezone to be only one. Thanks in advance!