I have a date-time character:
"01.01.2010 00:00"
I parse it to POSIXct
and set time zone:
df$date = as.POSIXct(df$date, format = "%m.%d.%Y %H:%M", tz = "Europe/Helsinki" )
and got
"2010-01-01 EET"
Then I tried to convert it to Date
:
as.Date(df$date[1], format = "%m.%d.%Y")
However, I got the previous date:
"2009-12-31"
I understand that problem lies somewhere in time zones, so I tried to format everything to tz = "Europe/Helsinki"
and it did not work. Can you help to solve the problem?