I have a data frame whose first 20 obs are like this:
userID appName startTime endTime endResult Handset Gend
Use strftime
to process the timestamps to what you desire, eg:
strftime("2012-07-28 00:58:05","%Y-%m-%d")
[1] "2012-07-28"
strftime("2012-07-28 00:58:05","%H:%M:%S")
[1] "00:58:05"
It's vectorised so you can use:
dfr$start.date <- strftime(dfr$startTime,"%Y-%m-%d")
dfr$start.time <- strftime(dfr$startTime,"%H:%M:%S")