How to compare only month and year? [VB]

前端 未结 4 797
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 12:23

Its quite simple, i just want to compare two dates using month and year, if the input date (mont and year only) are above or below that current date (month and year).

Th

4条回答
  •  囚心锁ツ
    2021-01-29 13:06

    Thank you everyone, but the final solutions is made with

    If (dDate.Year < DateTime.Now.Year Or (dDate.Year = DateTime.Now.Year And dDate.Month < DateTime.Now.Month)) Then
      'something                
     Else
      'something
    End If
    

提交回复
热议问题