Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting time string to time or numeric format

Tags:

time

r

I have a time column in the format of 00:00 00:30 01:00.

I want to subset to certain hours but I don't understand how to convert it to the right format
for the date i used as.date() is there someting similar?

like image 878
eliavs Avatar asked Apr 22 '26 00:04

eliavs


1 Answers

i am sorry i got it i used the strptime and strftime functions like so:

strftime(strptime(x, format="%H:%M"),"%H")

like image 139
eliavs Avatar answered Apr 23 '26 12:04

eliavs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!