This project is archived and is in readonly mode.

#877 ✓invalid
Ian Moody

Time.to_s wonky

Reported by Ian Moody | August 21st, 2008 @ 12:22 PM | in 2.x

Tell me I'm missing something obvious here, but the statement:

Time.now.to_s(:db)

In Rails 1.2.6 returns in the format:

'yyyy-mm-dd hh:mm:ss'

whilst in Rails 2.x.x it returns in the format:

'yyyy-mm-dd'

which may not seem like much but that conversion function is used to create every 'created_at' and 'updated_at' entry in the activerecord layer. The upshot seems to be that the time portion is now missing from all created_at and updated_at fields.

whenever I create an activerecord in rails 2.x.x the created_at and updated_at fields always have 00:00:00 as the time portion.

a quick scan of the source in activesupport/core_ext/(date/time/date_time)/conversions all looks ok, yet Time.now.to_s(:db) still crops off the time part

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages