0

I'm trying to show timestamp on .rhtml page, but it returns something like this:

Mon Dec 09 21:03:22 +0400 2013

How it should be:

2013.12.09 21:03:22

What's wrong? This is how I do:

<%= message.time %>
4

1 回答 1

1

利用strftime

message.time.strftime("%Y.%m.%d %H:%M:%S")
于 2013-12-09T17:19:44.760 回答