Reputation: 2082
When I am trying to convert csv time format into R time format using the below code, I get datetime format although i do not intend to do so.
Why and how can i avoid it?
bat2$or_time<-as.POSIXct(as.character(bob$Order_Time), format="%H:%M:%S")
Upvotes: 1
Views: 3010
Reputation: 2986
enclose your expression with format( 'your expression',"%H:%M:%S")
like so :
format(as.POSIXct(as.character(bob$Order_Time), format="%H:%M:%S"),"%H:%M:%S")
Upvotes: 0
Reputation: 2082
This did the Trick!
bat1$or_time<-as.POSIXlt(as.character(bat1$Order_Time), format="%H:%M:%S")
bat1$or_time<-format(bob$or_time, format="%H:%M:%S")
Upvotes: 1