This project is archived and is in readonly mode.

#3987 ✓wontfix
Carlos Rodriguez

Time.zone.today returns Date instead of ActiveSupport::TimeWithZone

Reported by Carlos Rodriguez | February 18th, 2010 @ 02:01 AM

Time.zone.now returns an ActiveSupport::TimeWithZone object
Time.zone.parse('02/17/2010') returns an ActiveSupport::TimeWithZone object
Time.zone.today returns a Date object

This means that you can do this:

Time.zone.parse('02/17/2010').beginning_of_day and have it return the correct time.

But you can't do this:

Time.zone.today.beginning_of_day and have it return the correct time.

Is this the expected behavior or is this a bug?

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