본문 바로가기
VB.net

윤달 체크 로직

by 호야호잇 2020. 9. 28.
    '윤달 체크 로직
    Dim Add_Day_YoonDal As Integer
    Private Sub Calc_YoonDal()
        Dim Chk_IsLeapYear As Boolean = Date.IsLeapYear(Now.Year)
        Dim Chk_IsLeapYear_Add1Year As Boolean = Date.IsLeapYear(Now.AddYears(1).Year)
        Dim Chk_IsLeapYear_Minus1Year As Boolean = Date.IsLeapYear(Now.AddYears(-1).Year)
        If Chk_IsLeapYear = True Or Chk_IsLeapYear_Add1Year = True Or Chk_IsLeapYear_Minus1Year = True Then
            Add_Day_YoonDal = 1
        Else
            Add_Day_YoonDal = 0
        End If
    End Sub