字符到日期格式转换

时间:2016-05-16 13:22:10

标签: r date as.date

x <- c("1-jan-60", "2-jan-89", "31-mar-89", "30-jul-93")
z <- as.Date(x, "%d-%b-%y")
z
"2060-01-01" "1989-01-02" "1989-03-31" "1993-07-30"

我将字符日期转换为日期格式,它将输出错误。

输出应为

"1960-01-01" "1989-01-02" "1989-03-31" "1993-07-30"

0 个答案:

没有答案