クラス
java.time.YearMonthの使用
-
java.timeでのYearMonthの使用
修飾子と型メソッド説明Year.atMonth
(int month) この年を月と組み合せてYearMonth
を作成します。この年を月と組み合せてYearMonth
を作成します。static YearMonth
YearMonth.from
(TemporalAccessor temporal) 時間的オブジェクトからYearMonth
のインスタンスを取得します。YearMonth.minus
(long amountToSubtract, TemporalUnit unit) 指定された量を減算した、この年-月のコピーを返します。YearMonth.minus
(TemporalAmount amountToSubtract) 指定された量を減算した、この年-月のコピーを返します。YearMonth.minusMonths
(long monthsToSubtract) 指定された月数を減算した、このYearMonth
のコピーを返します。YearMonth.minusYears
(long yearsToSubtract) 指定された年数を減算した、このYearMonth
のコピーを返します。static YearMonth
YearMonth.now()
デフォルトのタイムゾーンのシステム・クロックから現在の年-月を取得します。static YearMonth
指定されたクロックから現在の年-月を取得します。static YearMonth
指定されたタイムゾーンのシステム・クロックから現在の年-月を取得します。static YearMonth
YearMonth.of
(int year, int month) 年および月からYearMonth
のインスタンスを取得します。static YearMonth
年および月からYearMonth
のインスタンスを取得します。static YearMonth
YearMonth.parse
(CharSequence text) 2007-12
などのテキスト文字列からYearMonth
のインスタンスを取得します。static YearMonth
YearMonth.parse
(CharSequence text, DateTimeFormatter formatter) 特定のフォーマッタを使用して、テキスト文字列からYearMonth
のインスタンスを取得します。YearMonth.plus
(long amountToAdd, TemporalUnit unit) この年月のコピーに指定された時間を追加したものを返します。YearMonth.plus
(TemporalAmount amountToAdd) この年月のコピーに指定された時間を追加したものを返します。YearMonth.plusMonths
(long monthsToAdd) 指定された月数を加算した、このYearMonth
のコピーを返します。YearMonth.plusYears
(long yearsToAdd) 指定された年数を加算した、このYearMonth
のコピーを返します。YearMonth.with
(TemporalAdjuster adjuster) この年と月の調整済のコピーを返します。YearMonth.with
(TemporalField field, long newValue) 指定されたフィールドを新しい値に設定して、この年と月のコピーを返します。YearMonth.withMonth
(int month) 月を変更して、このYearMonth
のコピーを返します。YearMonth.withYear
(int year) 年を変更して、このYearMonth
のコピーを返します。