Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

Ruby – Get Julian Leap Year – Julian_leap?() Method – Examples & Explanation

The Julian leap method returns true if in the year in the given code is a leap year of the Proleptic Julian Calendar and false if not. The leap year comes after every 4 years. To get the Julian leap year you can use Date.julian_leap?() method.

julian_leap?() Method in Ruby

julian_leap?() method exists in Standard julian_leap? Library of Ruby. The purpose of this method is to get leap year from proleptic Julian Calendar.

 

Syntax of the julian_leap?() Method in Ruby

In date, the syntax of Julian leap method is:

 

Parameter of julian_leap?() Method in Ruby

The parameter x is any valid Julian date object. This parameter is required.Note: If the x parameter is not a valid Julian date object julian_leap?() method will return an error.

 

Return Value of julian_leap?()

julian_leap?() method return the true if the year mentioned in the code is a leap year of proleptic Julian Calendar.

 

Ruby julian_leap?() Year Example 1


Output
true

 

Ruby julian_leap?() Year Example 2


Output
false

 

Ruby julian_leap?() Year Example 3


Output
false

 

Ruby julian_leap?() Year Example 4


Output
true

 

Loading...
LearnAndLearn.com © 2018 - All rights reserved