On Thu, Jul 1, 2010 at 2:39 PM, melomane <[email protected]> wrote:

> Every auction is available for just one week. If i convert the string
> to date i can easily add one week to the date. During the week for
> every goods, clients can input their desired prices.But the new
> problems arise, how can I find today's date is equal to the end date?

Equal, or just not there yet?   :-)

>> endtime = Date.new(2010,7,4)
=> Sun, 04 Jul 2010
>> endtime.future?
=> true
>> now = DateTime.now.to_date
=> Thu, 01 Jul 2010
>> now.future?
=> false
>>

(see the doc for ActiveSupport::CoreExtensions::Date::Calculations)

> .. do i have to delete the prices of ended auctions in order
> to prevent the database getting bigger and bigger? or it is not
> important?

How much is "bigger"? If you can afford the disk space, why worry?

-- 
Hassan Schroeder ------------------------ [email protected]
twitter: @hassan

-- 
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