#482 invalid
Mark Percival

DateTime needs it's own to_time method

Reported by Mark Percival | July 24th, 2008 @ 03:59 PM

Currently if you use the Merb Helpers to grab DateTime objects and display them, you'll get some incorrect behavior.

Because DateTime inherits from Date, and merb_helpers adds the to_time method to Date, "my_dm_datetime.to_time" results in a time that ignores the hours and minutes and gets set automatically to midnight. This could be fixed by adding a to_time method to the DateTime object that returns the accurate time.

I've attached a file below that will demonstrate the problem and a proposed solution. There certainly could be a better way to do this, but this is the quick solution I'm using in my app.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

People watching this ticket