Hi, library(lubridate) ymd_hms(testtime) 1 parsed with %Y-%m-%d %I:%M:%S %p #[1] "2013-01-01 13:00:01 UTC" A.K.
----- Original Message ----- From: e-letter <inp...@gmail.com> To: r-help@r-project.org Cc: Sent: Friday, February 8, 2013 4:44 AM Subject: [R] convert 12 time stamp to 24 hour Readers, For a 12 hour time stamp: > testtime<-("2013-01-01 01:00:01 PM") > testtime [1] "2013-01-01 01:00:01 PM" > testtime24hour<-strftime(testtime,'%H:%M:%S') > testtime24hour [1] "01:00:01" how to convert to 24 hour format so that the object 'testtime24hour' is: '13:00:01' Thanks. -- r2151 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.