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