CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    When is it a Leap Year?

    Hi,

    Silly of me to ask this, but then...

    What are *ALL* the conditions that i need to check for, if i were to decide it the given year is a leap year?

    Ravi


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: When is it a Leap Year?


    public Function IsLeapYear(iYear as Integer) '-- Check for leap year
    If (iYear Mod 4 = 0) And _
    ((iYear Mod 100 <> 0) Or (iYear Mod 400 = 0)) then
    IsLeapYear = true
    else
    IsLeapYear = false
    End If
    End Function



    I got that function from a mailing list (if I only knew which one).


  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: When is it a Leap Year?

    Thanks a lot. That was Fast!..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured