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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -