Skip to content
Prev 321639 / 398500 Next

as.date not reading Hour/Minute am/pm Data

Hi,
Try:
x<- c("2/26/13 11:59 PM", "2/25/13 10:25 AM")
strptime(x,"%m/%d/%y %I:%M %p")
#[1] "2013-02-26 23:59:00" "2013-02-25 10:25:00"

#or
library(lubridate)
parse_date_time(x,"%m/%d/%y %I:%M %p")
# 2 parsed with %m/%d/%y %I:%M %p
#[1] "2013-02-26 23:59:00 UTC" "2013-02-25 10:25:00 UTC"
A.K.
why I'm not getting a as.date object to only store a limited amount of 
data. ?The date >is in the format of: 2/26/13 11:59 PM in a .csv file 
with over 5000 data points. ?My as.date function reads: