Calculating the difference of to dates

I want to calculate the difference (days, hours, minutes)
between a given date out of a mysql database (2007-07-07, date) and
the current date (Time.now).

How can I achieve this?

Thanx

···

--
Jochen Kaechelin
railswerk.de, gissmoh.de, figgfrosch.de, ror-ror.de

ex:

  require 'parsedate'

  sql_time = Time.mktime(*ParseDate.parsedate("2007-07-07"))
  cur_time = Time.now

  difference = cur_time - sql_time # result will be in seconds

Hope that helps.

···

On Thursday 09 August 2007 01:29:46 am Jochen Kaechelin wrote:

I want to calculate the difference (days, hours, minutes)
between a given date out of a mysql database (2007-07-07, date) and
the current date (Time.now).

How can I achieve this?

--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertillnoon.com/