Previously, to exclude seconds from datetime,
we had to parse datetime using
Let’s say we have a
and we need to show
purchased_at as a date time field excluding seconds.
This is our
And this is how our
views/products/show.html.erb would look like.
And this is how it will get rendered on the browser.
Now, Rails allows adding a
include_seconds option to
using which we can include/exclude the seconds.
This is how a browser renders it.
And suppose we need to include the seconds,
we can pass
for more details.