3

Can anyone explain this....

>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 

All of a sudden my strptime is confusing me... Why is mon = 2 rather than 3?

4

1 に答える 1

4

Following my comment, if you read ?DateTimeClasses, you'll see that for POSIXlt we have:

0–11: months after the first of the year.

于 2012-06-07T23:10:41.033 に答える