DateTime IsLeapYear VB.NET入門

DateTime IsLeapYear

DateTime構造体のIsLeapYearメソッド

閏年と判定する。

IsLeapYearは閏年を評価します。

閏年ならTrue
それ以外だとFalse
を返します。

ソース
Public Class Form1

Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click

MsgBox(DateTime.IsLeapYear(2000))
MsgBox(DateTime.IsLeapYear(2001))

End Sub
End Class

実行結果は
True
False

シェアする

  • このエントリーをはてなブックマークに追加

フォローする

Translate »