MikeJ MikeJ - 1 year ago 90
Ruby Question

Easy way to determine leap year in ruby?

Is there an easy way to determine if a year is a leap year?

Answer Source


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

From: http://www.ruby-doc.org/stdlib/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download