I am working in ruby, i ahave an object containing today's datetime from database. I only want time truncating the date. How can i get that?
Try DateTime#strftime.
DateTime.now.strftime("%H:%M") # => "12:17"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With