クラス
java.time.OffsetDateTimeの使用
| パッケージ | 説明 |
|---|---|
| java.time |
日付、時間、インスタント、デュレーションのメインAPI。
|
-
java.timeでのOffsetDateTimeの使用
OffsetDateTimeとして宣言されているjava.timeのフィールド 修飾子と型 フィールド 説明 static OffsetDateTimeOffsetDateTime. MAXサポートされている最大のOffsetDateTimeである「+999999999-12-31T23:59:59.999999999-18:00」。static OffsetDateTimeOffsetDateTime. MINサポートされている最小のOffsetDateTimeである「-999999999-01-01T00:00:00+18:00」。OffsetDateTimeを返すjava.timeのメソッド 修飾子と型 メソッド 説明 OffsetDateTimeOffsetTime. atDate(LocalDate date)この時間を日付と組み合せてOffsetDateTimeを作成します。OffsetDateTimeInstant. atOffset(ZoneOffset offset)このインスタントとオフセットを組み合わせてOffsetDateTimeを作成します。OffsetDateTimeLocalDateTime. atOffset(ZoneOffset offset)この日付/時間をオフセットと組み合せてOffsetDateTimeを作成します。OffsetDateTimeLocalDate. atTime(OffsetTime time)この日付をオフセット時間と組み合せてOffsetDateTimeを作成します。static OffsetDateTimeOffsetDateTime. from(TemporalAccessor temporal)時間的オブジェクトからOffsetDateTimeのインスタンスを取得します。OffsetDateTimeOffsetDateTime. minus(long amountToSubtract, TemporalUnit unit)指定された量を減算した、この日付/時間のコピーを返します。OffsetDateTimeOffsetDateTime. minus(TemporalAmount amountToSubtract)指定された量を減算した、この日付/時間のコピーを返します。OffsetDateTimeOffsetDateTime. minusDays(long days)指定された日数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusHours(long hours)指定された時間数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusMinutes(long minutes)指定された分数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusMonths(long months)指定された月数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusNanos(long nanos)指定されたナノ秒数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusSeconds(long seconds)指定された秒数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusWeeks(long weeks)指定された週数を減算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. minusYears(long years)指定された年数を減算して、このOffsetDateTimeのコピーを返します。static OffsetDateTimeOffsetDateTime. now()デフォルトのタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static OffsetDateTimeOffsetDateTime. now(Clock clock)指定されたクロックから現在の日付/時間を取得します。static OffsetDateTimeOffsetDateTime. now(ZoneId zone)指定されたタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static OffsetDateTimeOffsetDateTime. of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)年、月、日、時、分、秒、ナノ秒、およびオフセットからOffsetDateTimeのインスタンスを取得します。static OffsetDateTimeOffsetDateTime. of(LocalDate date, LocalTime time, ZoneOffset offset)日付、時間、およびオフセットからOffsetDateTimeのインスタンスを取得します。static OffsetDateTimeOffsetDateTime. of(LocalDateTime dateTime, ZoneOffset offset)日付/時間およびオフセットからOffsetDateTimeのインスタンスを取得します。static OffsetDateTimeOffsetDateTime. ofInstant(Instant instant, ZoneId zone)InstantおよびゾーンIDからOffsetDateTimeのインスタンスを取得します。static OffsetDateTimeOffsetDateTime. parse(CharSequence text)2007-12-03T10:15:30+01:00などのテキスト文字列からOffsetDateTimeのインスタンスを取得します。static OffsetDateTimeOffsetDateTime. parse(CharSequence text, DateTimeFormatter formatter)特定のフォーマッタを使用して、テキスト文字列からOffsetDateTimeのインスタンスを取得します。OffsetDateTimeOffsetDateTime. plus(long amountToAdd, TemporalUnit unit)この日時のコピーに指定された時間を追加したものを返します。OffsetDateTimeOffsetDateTime. plus(TemporalAmount amountToAdd)この日時のコピーに指定された時間を追加したものを返します。OffsetDateTimeOffsetDateTime. plusDays(long days)指定された日数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusHours(long hours)指定された時間数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusMinutes(long minutes)指定された分数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusMonths(long months)指定された月数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusNanos(long nanos)指定されたナノ秒数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusSeconds(long seconds)指定された秒数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusWeeks(long weeks)指定された週数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. plusYears(long years)指定された年数を加算して、このOffsetDateTimeのコピーを返します。OffsetDateTimeZonedDateTime. toOffsetDateTime()この日付/時間をOffsetDateTimeに変換します。OffsetDateTimeOffsetDateTime. truncatedTo(TemporalUnit unit)時間が切り捨てられた、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. with(TemporalAdjuster adjuster)この日付/時間の調整済のコピーを返します。OffsetDateTimeOffsetDateTime. with(TemporalField field, long newValue)指定されたフィールドを新しい値に設定して、この日付/時間のコピーを返します。OffsetDateTimeOffsetDateTime. withDayOfMonth(int dayOfMonth)「月の日」を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withDayOfYear(int dayOfYear)「年の日」を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withHour(int hour)時の値を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withMinute(int minute)分の値を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withMonth(int month)月を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withNano(int nanoOfSecond)ナノ秒の値を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withOffsetSameInstant(ZoneOffset offset)結果が同じインスタントを持つようにしながら、指定されたオフセットを使って、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withOffsetSameLocal(ZoneOffset offset)結果がローカル日付/時間を持つようにしながら、指定されたオフセットを使って、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withSecond(int second)秒の値を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTimeOffsetDateTime. withYear(int year)年を変更して、このOffsetDateTimeのコピーを返します。OffsetDateTime型の引数を持つ型を返すjava.timeのメソッド 修飾子と型 メソッド 説明 static Comparator<OffsetDateTime>OffsetDateTime. timeLineOrder()そのインスタントにのみ基づいて2つのOffsetDateTimeインスタンスを比較するコンパレータを取得します。OffsetDateTime型のパラメータを持つjava.timeのメソッド 修飾子と型 メソッド 説明 intOffsetDateTime. compareTo(OffsetDateTime other)この日付/時間を別の日付/時間と比較します。booleanOffsetDateTime. isAfter(OffsetDateTime other)この日付/時間のインスタントが、指定された日付/時間のインスタントより後であるかどうかをチェックします。booleanOffsetDateTime. isBefore(OffsetDateTime other)この日付/時間のインスタントが、指定された日付/時間のインスタントより前であるかどうかをチェックします。booleanOffsetDateTime. isEqual(OffsetDateTime other)この日付/時間のインスタントが、指定された日付/時間のインスタントと等しいかどうかをチェックします。