On 25 April 2011 22:37, Lee
<lhughes30-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have Time fields in my PostgreSQL tables, which I force to display
> as time only with this entry in config/locales/en.yml:
>
> time:
> formats:
> default: "%H:%M:%S"
>
>
> Problem is, that format is now applied to Timestamp fields, including
> the default created_at and updated_at fields.
>
> Why is it applying the Time (time only) format to a Timestamp (date +
> time) field, and how do I rectify this problem?
Timestamp fields are stored in TimeWithZone objects, so are of type
Time and your defaults will apply. You could use strftime to format
those for which the default is not appropriate, or don''t bother with
changing the default, just use strftime always.
Colin
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.