Ruby comparing dates

Posted by fenec on Stack Overflow See other posts from Stack Overflow or by fenec
Published on 2010-05-16T01:20:53Z Indexed on 2010/05/16 1:30 UTC
Read the original article Hit count: 316

Filed under:
|
|

I would like to do is to know if a user has been created in the system in the last 10 second. so i would do:

  def new_user
    if(DateTime.now - User.created_at < 10)
      return true
    else 
      return false 
    end
  end

IT is just an idea , how can i do it correctly? thank you

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby