1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hebrew Leap Year

Discussion in 'T&T - Functions' started by Joe Caverly, Mar 7, 2010.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    The code below includes a function to calculate if a Hebrew Year is a Hebrew Leap Year.

    Code:
    @setlocal
    @echo off
    function IsLeapYear=`%@eval[((%1 * 7 + 1) mod 19) < 7]`
    ::
    :: Yom Rishon, Adar 21, 5770 is Sunday, March 7, 2010
    ::   After sunset, it will be Yom Sheni, Adar 22, 5770
    ::
    do i=5770 to 5779
      if %@IsLeapYear[%i] eq 1 echo %i is a Hebrew Leap Year
    enddo
    unfunction IsLeapYear
    endlocal
    
    Joe
     

Share This Page