rails 3 - strftime is outputting the same time? -
i have following:
<% @comments.reverse.each |comment| %> <%= comment.created_at.strftime("%b %d, %y @ %l:%m %p") %>< <% end %>
for unknown reason time being outputted in loop identical every entry?
example:
- dec 01, 2010 @ 1:12 pm
- dec 01, 2010 @ 1:12 pm
- dec 01, 2010 @ 1:12 pm
- dec 01, 2010 @ 1:12 pm
but if change to:
<% @comments.reverse.each |comment| %> <%= comment.created_at %>< <% end %>
if outputs correct raw timestamps, not pretty. ideas here?
thanks
it looks using wrong formats display. example %m month , not minute. minute %m
here reference use: http://www.ruby-doc.org/core/classes/time.html#m000298
Comments
Post a Comment