Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Single Digit Month and Day to POSIXct

Tags:

datetime

r

Looking at time format specifiers I don't see any options for dates like 2/5/2010 (Month/Day/Year, single digit, no leading spaces). Are there any built in methods for converting dates in this format?

like image 966
Kyle Brandt Avatar asked Feb 02 '12 20:02

Kyle Brandt


1 Answers

as.POSIXct('2/5/2010',format='%m/%d/%Y')

see ?strptime for formatting options.

like image 58
Justin Avatar answered Oct 26 '22 07:10

Justin