By default, whenever you stick a Time in a web page, e.g. <%=
created_at %>, it gets formatted as an unwieldy string: "Thu May 24
21:19:11 BST 2007"
I've discovered that I can improve this using <%= created_at.to_s(:db)
%> to get "2007-05-24 21:19:11"
However, is there a way to set the default conversion globally? Or do
I have to find every template which includes a Time field and manually
change it?
By default, whenever you stick a Time in a web page, e.g. <%=
created_at %>, it gets formatted as an unwieldy string: "Thu May 24
21:19:11 BST 2007"
I've discovered that I can improve this using <%= created_at.to_s(:db)
%> to get "2007-05-24 21:19:11"
However, is there a way to set the default conversion globally? Or do
I have to find every template which includes a Time field and manually
change it?