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