List Info

Thread: Change timestamp format




Change timestamp format
user name
2006-07-12 20:08:11
On 7/12/06, R. N. Dominick <rdominickgmail.com> wrote:
>
>   <p class="author">
>     Posted by <cite><%= author_link(article)
%></cite> on
>     <abbr class="published"
title="<%= article.created_at.xmlschema
> %>"><%= article.published_at
%></abbr>
>   </p>
>
> This results in the kind-of graceless but pretty geeky
byline
>
> Posted by R. N. Dominick on Tue Jul 11 11:07:00 EDT
2006
>
> but I like it.

You can also use article.published_at.strftime to get better
control
over the format.  Run 'ri strftime' or 'man strftime' to
see all of
the options.


Scott
_______________________________________________
Typo-list mailing list
Typo-listrubyforge.org
http:
//rubyforge.org/mailman/listinfo/typo-list
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )