Date.today is part of Ruby standard library (not added by Rails).

jeremy

2009/8/30 Maurício Linhares <[email protected]>:
>
> Time has no today method, today is a Date method added by rails, as in
> Date.today.
>
> The method that looks like the same in time is Time.now.
>
> -
> Maurício Linhares
> http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
>
>
>
> On Sun, Aug 30, 2009 at 4:58 PM, Kieran P<[email protected]> wrote:
>>
>> You can do something like this (utilizing a Rails time method):
>>
>> class Time
>>  def self.today
>>    Time.now.beginning_of_day
>>  end
>> end
>>
>>>> Time.today
>> => Mon Aug 31 00:00:00 +1200 2009
>>
>> Regards
>> Kieran
>>
>> On Aug 29, 8:24 pm, Fernando Perez <[email protected]>
>> wrote:
>>> > Time.today exists on 1.8.7,
>>> > but not 1.9.1 (or 1.8.6 to my knowledge)
>>>
>>> Damn that's the answer!
>>> --
>>> Posted viahttp://www.ruby-forum.com/.
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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