On Dec 5, 10:02 pm, Günther Lackner <[EMAIL PROTECTED]>
wrote:
> Hi!
>
> I need to calculate the difference between two Datetime and convert it
> into minutes.
>
> diff = Time.now() - my_date
>
> How can I convert diff now into minutes?
>
What class is my_date ? (my_date.class)
Is it DateTime, or is TIme or ActiveSupport::TimeWithZone ?
In general, the difference seems to be in seconds when you subtract
two objects of the same class so you'd divide by 60 to get minutes.  I
think you can also subtract between Time and TimeWithZone but you may
run into trouble with other combinations.

--
Daniel Bush

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to