R: How to convert date from% b for different languages
I'm new to R and I'm having a hard time converting a date. Consider the following:
> A <- '30-Abr-17' #Portuguese
> B <- '30-Apr-17' #English
> as.POSIXct(A, '%d-%b-%y', tz = '')
[1] "2017-04-30 -03"
> as.POSIXct(B, '%d-%b-%y', tz = '')
[1] NA
When i use
tz = ''
It uses my timezone which:
> Sys.timezone()
[1] "America/Sao_Paulo"
I've tried something like:
as.POSIXct(B, '%d-%b-%y', tz = 'America/New_York')
[1] NA
But it still didn't work. Any ideas?
Thank.
+3
source to share
1 answer