クラス
java.time.ZoneOffsetの使用
ZoneOffsetを使用するパッケージ
パッケージ
説明
日付、時間、インスタント、デュレーションのメインAPI。
デフォルトのISO暦以外の暦体系の汎用API。
フィールドと単位を使用した日時へのアクセス、および日時アジャスタ。
タイムゾーンおよびそのルールのサポート。
-
java.timeでのZoneOffsetの使用
ZoneOffsetとして宣言されたjava.timeのフィールド修飾子と型フィールド説明static final ZoneOffsetZoneOffset.MAXサポートされる最大オフセットの定数です。static final ZoneOffsetZoneOffset.MINサポートされている最小オフセットの定数。static final ZoneOffsetZoneOffset.UTCUTC用のタイムゾーン・オフセット(IDがZ)。ZoneOffsetを返すjava.timeのメソッド修飾子と型メソッド説明static ZoneOffsetZoneOffset.from(TemporalAccessor temporal) 時間的オブジェクトからZoneOffsetのインスタンスを取得します。OffsetDateTime.getOffset()「+01:00」などのゾーン・オフセットを取得します。OffsetTime.getOffset()「+01:00」などのゾーン・オフセットを取得します。ZonedDateTime.getOffset()「+01:00」などのゾーン・オフセットを取得します。static ZoneOffsetIDを使用してZoneOffsetのインスタンスを取得します。static ZoneOffsetZoneOffset.ofHours(int hours) オフセット(時)を使用してZoneOffsetのインスタンスを取得します。static ZoneOffsetZoneOffset.ofHoursMinutes(int hours, int minutes) オフセット(時と分)を使用してZoneOffsetのインスタンスを取得します。static ZoneOffsetZoneOffset.ofHoursMinutesSeconds(int hours, int minutes, int seconds) オフセット(時、分および秒)を使用してZoneOffsetのインスタンスを取得します。static ZoneOffsetZoneOffset.ofTotalSeconds(int totalSeconds) 合計オフセット(秒)を指定してZoneOffsetのインスタンスを取得します。型ZoneOffsetのパラメータを持つjava.timeのメソッド修飾子と型メソッド説明Instant.atOffset(ZoneOffset offset) このインスタントとオフセットを組み合わせてOffsetDateTimeを作成します。LocalDateTime.atOffset(ZoneOffset offset) この日付/時間をオフセットと組み合せてOffsetDateTimeを作成します。LocalTime.atOffset(ZoneOffset offset) この時間をオフセットと組み合せてOffsetTimeを作成します。intZoneOffset.compareTo(ZoneOffset other) このオフセットを別のオフセットと降順で比較します。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 OffsetTimeOffsetTime.of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) 時、分、秒、およびナノ秒からOffsetTimeのインスタンスを取得します。static OffsetTimeOffsetTime.of(LocalTime time, ZoneOffset offset) ローカル時間およびオフセットからOffsetTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset offset) エポック(1970-01-01T00:00:00Z)からの秒数を使用して、LocalDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) ローカル日付/時間とオフセットを組み合せることで形成されるインスタントからZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset) 可能であれば優先オフセットを使用して、ローカル日付/時間からZonedDateTimeのインスタンスを取得します。static ZoneIdZoneId.ofOffset(String prefix, ZoneOffset offset) ZoneIdのインスタンスを取得して、オフセットをラップします。static ZonedDateTimeZonedDateTime.ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) ローカル日付/時間、オフセット、およびゾーンIDの組合せを厳密に検証して、ZonedDateTimeのインスタンスを取得します。longLocalDate.toEpochSecond(LocalTime time, ZoneOffset offset) このLocalDateを、1970-01-01T00:00:00Zのエポック以降の秒数に変換します。longLocalTime.toEpochSecond(LocalDate date, ZoneOffset offset) このLocalTimeを、1970-01-01T00:00:00Zのエポック以降の秒数に変換します。OffsetDateTime.withOffsetSameInstant(ZoneOffset offset) 結果が同じインスタントを持つようにしながら、指定されたオフセットを使って、このOffsetDateTimeのコピーを返します。OffsetTime.withOffsetSameInstant(ZoneOffset offset) 結果が暗黙の日の同じインスタントを持つようにしながら、指定されたオフセットを使ってこのOffsetTimeのコピーを返します。OffsetDateTime.withOffsetSameLocal(ZoneOffset offset) 結果がローカル日付/時間を持つようにしながら、指定されたオフセットを使って、このOffsetDateTimeのコピーを返します。OffsetTime.withOffsetSameLocal(ZoneOffset offset) 結果が同じローカル時間を持つようにしながら、指定されたオフセットを使ってこのOffsetTimeのコピーを返します。 -
java.time.chronoでのZoneOffsetの使用
ZoneOffsetを返すjava.time.chronoのメソッド型ZoneOffsetのパラメータを持つjava.time.chronoのメソッド修飾子と型メソッド説明default longChronology.epochSecond(int prolepticYear, int month, int dayOfMonth, int hour, int minute, int second, ZoneOffset zoneOffset) 1970-01-01T00:00:00Zのエポックから秒数を取得します。default longChronology.epochSecond(Era era, int yearOfEra, int month, int dayOfMonth, int hour, int minute, int second, ZoneOffset zoneOffset) 1970-01-01T00:00:00Zのエポックから秒数を取得します。longIsoChronology.epochSecond(int prolepticYear, int month, int dayOfMonth, int hour, int minute, int second, ZoneOffset zoneOffset) 1970-01-01T00:00:00Zのエポックから秒数を取得します。default longChronoLocalDateTime.toEpochSecond(ZoneOffset offset) この日付/時間を、エポック(1970-01-01T00:00:00Z)からの秒数に変換します。default InstantChronoLocalDateTime.toInstant(ZoneOffset offset) この日付/時間をInstantに変換します。 -
java.time.temporalでのZoneOffsetの使用
型ZoneOffsetの引数を持つ型を返すjava.time.temporalのメソッド修飾子と型メソッド説明static TemporalQuery<ZoneOffset> TemporalQueries.offset()ZoneOffsetの問合せ。見つからない場合はnullを返します。 -
java.time.zoneでのZoneOffsetの使用
ZoneOffsetを返すjava.time.zoneのメソッド修飾子と型メソッド説明これらのルールで、指定されたインスタントに適用できるオフセットを取得します。ZoneRules.getOffset(LocalDateTime localDateTime) これらのルールで、指定されたローカル日付/時間に適したオフセットを取得します。ZoneOffsetTransition.getOffsetAfter()遷移後のオフセットを取得します。ZoneOffsetTransitionRule.getOffsetAfter()遷移後のオフセットを取得します。ZoneOffsetTransition.getOffsetBefore()遷移前のオフセットを取得します。ZoneOffsetTransitionRule.getOffsetBefore()遷移前のオフセットを取得します。ZoneOffsetTransitionRule.getStandardOffset()遷移時に有効な標準オフセットを取得します。ZoneRules.getStandardOffset(Instant instant) このゾーンでの指定されたインスタントの標準オフセットを取得します。型ZoneOffsetの引数を持つ型を返すjava.time.zoneのメソッド修飾子と型メソッド説明ZoneRules.getValidOffsets(LocalDateTime localDateTime) これらのルールで指定されたローカル日付/時間に適用できるオフセットを取得します。型ZoneOffsetのパラメータを持つjava.time.zoneのメソッド修飾子と型メソッド説明ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime, ZoneOffset standardOffset, ZoneOffset wallOffset) 指定されたローカル日付/時間を、実際に壁掛け時計に見られるようなローカル日付/時間に変換します。booleanZoneOffsetTransition.isValidOffset(ZoneOffset offset) 指定されたオフセットがこの遷移中に有効であるかどうかを確認します。booleanZoneRules.isValidOffset(LocalDateTime localDateTime, ZoneOffset offset) オフセット日付/時間がこれらのルールに対して有効であるかどうかを確認します。static ZoneOffsetTransitionZoneOffsetTransition.of(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) 2つのオフセット間の遷移を定義するインスタンスを取得します。static ZoneOffsetTransitionRuleZoneOffsetTransitionRule.of(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, boolean timeEndOfDay, ZoneOffsetTransitionRule.TimeDefinition timeDefinition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter) 2つのオフセット間の遷移を作成するための年間ルールを定義するインスタンスを取得します。static ZoneRulesZoneRules.of(ZoneOffset offset) 固定ゾーン・ルールを持つZoneRulesのインスタンスを取得します。static ZoneRulesZoneRules.of(ZoneOffset baseStandardOffset, ZoneOffset baseWallOffset, List<ZoneOffsetTransition> standardOffsetTransitionList, List<ZoneOffsetTransition> transitionList, List<ZoneOffsetTransitionRule> lastRules) ZoneRulesのインスタンスを取得します。