クラス
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 ZonedDateTime
ZonedDateTime.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 ZonedDateTime
ZonedDateTime.now()
デフォルトのタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static ZonedDateTime
指定されたクロックから現在の日付/時間を取得します。static ZonedDateTime
指定されたタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static ZonedDateTime
ZonedDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone)
年、月、日、時、分、秒、ナノ秒、およびタイムゾーンからZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ローカルの日付と時間からZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ZonedDateTime.of(LocalDateTime localDateTime, ZoneId zone)
ローカル日付/時間からZonedDateTime
のインスタンスを取得します。static ZonedDateTime
Instant
からZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
ローカル日付/時間とオフセットを組み合せることで形成されるインスタントからZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ZonedDateTime.ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset)
可能であれば優先オフセットを使用して、ローカル日付/時間からZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ZonedDateTime.ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
ローカル日付/時間、オフセット、およびゾーンIDの組合せを厳密に検証して、ZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ZonedDateTime.parse(CharSequence text)
2007-12-03T10:15:30+01:00[Europe/Paris]
などのテキスト文字列からZonedDateTime
のインスタンスを取得します。static ZonedDateTime
ZonedDateTime.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 GregorianCalendar
GregorianCalendar.from(ZonedDateTime zdt)
ZonedDateTime
オブジェクトからデフォルトのロケールを使ってGregorianCalendar
のインスタンスを取得します。