anyone can help me with this?
In my view I have: <%= post.time %>
It displays on the screen for the row: Sat Jan 01 17:18:00 UTC 2000
In every row it says "Sat Jan 01" + "UTC 2000"
How can I get rid of it and display only the time?
Many thanks
<%= post.date.strftime('%H:%M:%S') %>
You can read the reference for the full formatting syntax here. For example:
%S - Second of the minute (00..60)
%H - Hour of the day, 24-hour clock (00..23)
. . . and so on.
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