クラス
java.time.ZonedDateTimeの使用
ZonedDateTimeを使用するパッケージ
パッケージ
説明
日付、時間、インスタント、デュレーションのメインAPI。
デフォルトのISO暦以外の暦体系の汎用API。
コレクション・フレームワーク、国際化サポート・クラス、サービス・ローダー、プロパティ、乱数生成、文字列解析とスキャニング・クラス、Base64エンコーディングとデコーディング、ビット配列、およびその他のユーティリティ・クラスが含まれています。
-
java.timeでのZonedDateTimeの使用
ZonedDateTimeを返すjava.timeのメソッド修飾子と型メソッド説明LocalDate.atStartOfDay(ZoneId zone) タイムゾーンのルールに従って、この日付のもっとも早い有効な時間からゾーン付きの日付/時間を返します。このインスタントとタイムゾーンを組み合わせてZonedDateTimeを作成します。この日付/時間をタイムゾーンと組み合せてZonedDateTimeを作成します。OffsetDateTime.atZoneSameInstant(ZoneId zone) 結果に同じインスタントが含まれるようにしながら、この日付/時間をタイムゾーンと組み合わせてZonedDateTimeを作成します。OffsetDateTime.atZoneSimilarLocal(ZoneId zone) 同じローカルの日付と時間を保持するようにしながら、この日付/時間をタイムゾーンと組み合わせてZonedDateTimeを作成します。static ZonedDateTimeZonedDateTime.from(TemporalAccessor temporal) 時間的オブジェクトからZonedDateTimeのインスタンスを取得します。ZonedDateTime.minus(long amountToSubtract, TemporalUnit unit) 指定された量を減算した、この日付/時間のコピーを返します。ZonedDateTime.minus(TemporalAmount amountToSubtract) 指定された量を減算した、この日付/時間のコピーを返します。ZonedDateTime.minusDays(long days) 指定された日数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusHours(long hours) 指定された時間数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusMinutes(long minutes) 指定された分数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusMonths(long months) 指定された月数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusNanos(long nanos) 指定されたナノ秒数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusSeconds(long seconds) 指定された秒数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusWeeks(long weeks) 指定された週数を減算して、このZonedDateTimeのコピーを返します。ZonedDateTime.minusYears(long years) 指定された年数を減算して、このZonedDateTimeのコピーを返します。static ZonedDateTimeZonedDateTime.now()デフォルトのタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static ZonedDateTime指定されたクロックから現在の日付/時間を取得します。static ZonedDateTime指定されたタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static ZonedDateTimeZonedDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone) 年、月、日、時、分、秒、ナノ秒、およびタイムゾーンからZonedDateTimeのインスタンスを取得します。static ZonedDateTimeローカルの日付と時間からZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.of(LocalDateTime localDateTime, ZoneId zone) ローカル日付/時間からZonedDateTimeのインスタンスを取得します。static ZonedDateTimeInstantからZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) ローカル日付/時間とオフセットを組み合せることで形成されるインスタントからZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset) 可能であれば優先オフセットを使用して、ローカル日付/時間からZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) ローカル日付/時間、オフセット、およびゾーンIDの組合せを厳密に検証して、ZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.parse(CharSequence text) 2007-12-03T10:15:30+01:00[Europe/Paris]などのテキスト文字列からZonedDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.parse(CharSequence text, DateTimeFormatter formatter) 特定のフォーマッタを使用して、テキスト文字列からZonedDateTimeのインスタンスを取得します。ZonedDateTime.plus(long amountToAdd, TemporalUnit unit) この日時のコピーに指定された時間を追加したものを返します。ZonedDateTime.plus(TemporalAmount amountToAdd) この日時のコピーに指定された時間を追加したものを返します。ZonedDateTime.plusDays(long days) 指定された日数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusHours(long hours) 指定された時間数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusMinutes(long minutes) 指定された分数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusMonths(long months) 指定された月数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusNanos(long nanos) 指定されたナノ秒数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusSeconds(long seconds) 指定された秒数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusWeeks(long weeks) 指定された週数を加算して、このZonedDateTimeのコピーを返します。ZonedDateTime.plusYears(long years) 指定された年数を加算して、このZonedDateTimeのコピーを返します。OffsetDateTime.toZonedDateTime()オフセットをゾーンIDとして使用して、この日付/時間をZonedDateTimeに変換します。ZonedDateTime.truncatedTo(TemporalUnit unit) 時間が切り捨てられた、このZonedDateTimeのコピーを返します。ZonedDateTime.with(TemporalAdjuster adjuster) この日付/時間の調整済のコピーを返します。ZonedDateTime.with(TemporalField field, long newValue) 指定されたフィールドを新しい値に設定して、この日付/時間のコピーを返します。ZonedDateTime.withDayOfMonth(int dayOfMonth) 日の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withDayOfYear(int dayOfYear) 「年の日」を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withEarlierOffsetAtOverlap()ゾーン・オフセットを、ローカル時系列のオーバーラップ時における2つの有効なオフセットのうちの早い方に変更して、この日付/時間のコピーを返します。ZonedDateTime.withFixedOffsetZone()ゾーンIDをオフセットに設定して、この日付/時間のコピーを返します。ZonedDateTime.withHour(int hour) 時の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withLaterOffsetAtOverlap()ゾーン・オフセットを、ローカル時系列のオーバーラップ時における2つの有効なオフセットのうちの遅い方に変更して、この日付/時間のコピーを返します。ZonedDateTime.withMinute(int minute) 分の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withMonth(int month) 月の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withNano(int nanoOfSecond) ナノ秒の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withSecond(int second) 秒の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withYear(int year) 年の値を変更して、このZonedDateTimeのコピーを返します。ZonedDateTime.withZoneSameInstant(ZoneId zone) インスタントを保持したまま、別のタイムゾーンを使ってこの日付/時間のコピーを返します。ZonedDateTime.withZoneSameLocal(ZoneId zone) 可能であればローカル日付/時間を保持したまま、別のタイムゾーンを使って、この日付/時間のコピーを返します。 -
java.time.chronoでのZonedDateTimeの使用
ZonedDateTimeを返すjava.time.chronoのメソッド修飾子と型メソッド説明IsoChronology.zonedDateTime(Instant instant, ZoneId zone) Instantからこの暦でISOのゾーン付きの日付/時間を取得します。IsoChronology.zonedDateTime(TemporalAccessor temporal) もう一方の日付/時間オブジェクトからISOのゾーン付きの日付/時間を取得します。 -
java.utilでのZonedDateTimeの使用
ZonedDateTimeを返すjava.utilのメソッド修飾子と型メソッド説明GregorianCalendar.toZonedDateTime()このオブジェクトを、時系列上でこのGregorianCalendarと同じ時点を表すZonedDateTimeに変換します。型ZonedDateTimeのパラメータを持つjava.utilのメソッド修飾子と型メソッド説明static GregorianCalendarGregorianCalendar.from(ZonedDateTime zdt) ZonedDateTimeオブジェクトからデフォルトのロケールを使ってGregorianCalendarのインスタンスを取得します。