This a feature request corresponding to bug 17212.
Currently, 'strptime' returns NA if the format string contains a month specifier with no day-of-month specifier. This is confusing and not useful. Since no code will be expected to depend on this behavior, I suggest improving it in a backwards-compatible way.
- If the month is specified but no day, then a POSIXlt should be returned with the day set to 1.
- The documentation for "%m" specifier should point to NOTES or wherever the special behavior of months is documented. Similarly for "%Y".
- Currently, strptime returns the current month and day when only "%Y" is specified. Some programs may depend on this behavior. However, this has the same potential problems as "%m", since certain month/day combinations (i.e. Feb 29) may not be available in all years. Furthermore, having the output of 'strptime' depend on the current date can cause difficult-to-detect "zero-day" bugs which don't show up in testing. Users should be given the option of fixing this behavior with a new 'template' argument which provides a POSIXlt argument to be used as a template for the 'strptime' return value. E.g.:
 "1970-07-01 UTC"
 "2001-01-01 UTC"