Skip to content

Can strptime handle milliseconds or AM/PM?

2 messages · e-letter, Brian Ripley

#
On 17/01/2013 07:59, e-letter wrote:
Because you have not specified a complete date-time, only month = 20 
(which is invalid).

The help page actually has

      z <- strptime("20/2/06 11:16:16.683", "%d/%m/%y %H:%M:%OS")

I guess you were looking for

strftime(z, "%m")

which gives "02" on my system (it may be platform-specific)

or

z$mon + 1