Tree Menu

J#(Java)月 (Month) を取得する

DateTime のインスタンスから月 (Month) を取得するには Month プロパティを参照します。

サンプルコード

以下にサンプルコードを示します。

J# (Java)
    // 必要な変数を宣言する
    System.DateTime  dtNow = System.DateTime.get_Now();

    // 月 (Month) を取得する
    int iMonth = dtNow.get_Month();