[R] convert 12 time stamp to 24 hour

e-letter inpost at gmail.com
Mon Feb 11 10:45:55 CET 2013


On 08/02/2013, e-letter <inpost at gmail.com> wrote:
> 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"
>

Have realised that the object is of type 'character'. When this
conversion is applied to a vector and then the 'plot' function applied
(i.e. plot another vector against the vector of 24-hour time series
values), receive an error.

How to convert the values "01:00:01" to 'ts' objects?



More information about the R-help mailing list