Is there an existent lib or such that gives me some date/time calculations ?
Time.now - 2.minutes for instance ?
Thanks,
···
--
Peter Fitzgibbons
Is there an existent lib or such that gives me some date/time calculations ?
Time.now - 2.minutes for instance ?
Thanks,
--
Peter Fitzgibbons
Time.now - 2 * 60
or
(some people would argue that this is the best approach)
Minute = 60
Hour = Minute * 60
Day = Hour * 24
Time.now - 2 * Minute
or
The ActiveSupport library for Rails has those sorts of methods defined.
or
I think Facets might have these, too.
or
Roll your own. They are easy to write.
Kirk Haines
On Monday 21 November 2005 3:48 pm, Peter Fitzgibbons wrote:
Is there an existent lib or such that gives me some date/time calculations
?Time.now - 2.minutes for instance ?
ActiveSupport, which is part of Rails, has this stuff. Take a look:
http://api.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Numeric/Time.html#M000234
Ryan
On 11/21/05, Peter Fitzgibbons <peter.fitzgibbons@gmail.com> wrote:
Is there an existent lib or such that gives me some date/time calculations ?
Time.now - 2.minutes for instance ?