I'm new to Ruby on Rails and I just did a Blog tutorial to learn the basics. What I need to know now how to display in a post the date/time of creation and show also how old is it. I tried something but I cannot understand how to display the current local time of creation. Like I create the post in the US but in DK I see the local time. However, I would like to extend this to show also the post in a chronological way.
The code:
<h2><%= @post.title %></h2>
<p><%= @post.body %></p>
<p> <%= @post.created_at.strftime('%B %d %Y, %l:%M%P, %z') %></p>
<hr>
<%= link_to 'Edit', edit_post_path(@post), :class => 'btn btn-default'%>
<%= link_to 'Delete', post_path(@post),
method: :delete,
data: {confirm: 'Are you sure?'},
:class => 'btn btn-danger'
%>
<hr>
<%= render 'comments/comments' %>
<%= render 'comments/form' %>