2012-06-07 42 views
3

谁能解释这一点....日期函数问题

>strptime("19300307", "%Y%m%d") 
    "1930-03-07" 
>unlist(strptime("19300307", "%Y%m%d")) 
    sec min hour mday mon year wday yday isdst 
    0  0  0  7  2 30  5 65  0 

突然我的strptime的是混淆了我... 为什么星期一= 2,而不是3 ?

+0

与1月一起试用。也许它从0开始? – joran

+0

@joran你是对的先生! (R中唯一的索引0的东西) – Justin

+0

@Justin我想不出任何其他的例子,但我确信有一些在那里。 – joran

回答

4

按照我的意见,如果你读?DateTimeClasses,你会看到,POSIXlt我们:

0-11:个月来首次年后。