[Nitro] [NP.ORG] Nitro/Og Fora daily digest

Reid Thompson reid.thompson at ateb.com
Mon May 21 20:18:42 EDT 2007


george.moschovitis at gmail.com wrote:
> >From gmosx.myopenid.com 
> Date: Mon May 21 12:08:48 UTC 2007
> Subject: Special compare of Ruby Time objects
> Message-ID: http://www.nitroproject.org/fora/posts/view/airz-Eb5qr3jvheJeZaaqU
>
> Dear devs,
>
> is there an elegant way to find out if two Time objects represent the same day, ie ignore the hh:mm:ss part of the Time object in this comparisson?
>
> thanks in advance,
> -g.
>
>
>
>
> --
> This mail is automatically generated from the http://nitroproject.org/fora
> digest robot. It presents the discussions in the fora during the last 24 hours.
> Do not reply to this email.
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>   
is

    t1 = Time.now
    t2 = Time.now

    if (t1.day == t2.day)
    then
      puts "the days are the same"
    else
        puts "the days are different"
    end

    t2 = t2 + 100323

    if (t1.day == t2.day)
    then
      puts "the days are the same"
    else
        puts "the days are different"
    end

elegant????


More information about the Nitro-general mailing list