0
考虑以下代码:代码解释as.Date
test_date<-"01-Jan-64"
as.Date(test_date,"%d-%b-%y")
## [1] "2064-01-01"
test_date<-"01-Jan-69"
as.Date(test_date,"%d-%b-%y")
## [1] "1969-01-01"
为什么64被解读为2064和69在1969年?
考虑以下代码:代码解释as.Date
test_date<-"01-Jan-64"
as.Date(test_date,"%d-%b-%y")
## [1] "2064-01-01"
test_date<-"01-Jan-69"
as.Date(test_date,"%d-%b-%y")
## [1] "1969-01-01"
为什么64被解读为2064和69在1969年?
从?strptime
%Y 一年不世纪(00-99)。在输入时,值为00到68的前缀是20和69到99乘19 - 这是2004和2008 POSIX标准指定的行为...
基本上不使用两位数年任何含糊不清的风险。
这是有益的...谢谢:-) – Dhanraj