Time (leap year?)

Try:

now = DateTime.now
flag = Date.leap?( now.year )

···

--
Michael Kelly
Sr. Software Engineer
Eleven Wireless Inc. - The Possibilities are Wireless

-----Original Message-----
From: csjasnoch@wisc.edu [mailto:csjasnoch@wisc.edu]
Sent: Wednesday, August 31, 2005 1:06 PM
To: ruby-talk ML
Subject: Time (leap year??)

Is there a simple way to see if a year is a leap year (rather than
writting an algorithm I wanted to check if it is already implimented
first)

It would be kewl if there was just a check on a Time var

Like,

now = Time.new
flag = now.leapyear?

Wow that was fast:)
Thanx

Where could I find descriptions of the DateTime class?

I only really know about the Time class....

Does it have all of the same members and methods?

<http://www.ruby-doc.org/core/classes/Date.html&gt;

The sidebar from ruby-doc.org are really helpful to quickly look up
class definitions: <http://www.ruby-doc.org/docbar/&gt;

-Levin

···

csjasnoch@wisc.edu <csjasnoch@wisc.edu> wrote:

Where could I find descriptions of the DateTime class?