java.time.OffsetDateTimeクラス
前書き
ザ・ java.time.OffsetDateTime classは、2007-12-03T10:15:30 + 01:00など、ISO-8601カレンダーシステムのUTC /グリニッジからのオフセットを持つ日時を表します。
クラス宣言
以下はの宣言です java.time.OffsetDateTime クラス-
public final class OffsetDateTime
extends Object
implements Temporal, TemporalAdjuster, Comparable<OffsetDateTime>, Serializable
フィールド
以下はのフィールドです java.time.OffsetDateTime クラス-
static OffsetDateTime MAX −サポートされる最大OffsetDateTime、「+ 999999999-12-31T23:59:59.999999999 + 18:00」。
static OffsetDateTime MIN −サポートされる最小のOffsetDateTime、「-999999999-01-01T00:00:00-18:00」。
クラスメソッド
| シニア番号 | 方法と説明 |
|---|---|
| 1 | 時間的adjustInto(時間的時間的) 指定された時間オブジェクトを、このオブジェクトと同じ日時になるように調整します。 |
| 2 | ZonedDateTime atZoneSameInstant(ZoneIdゾーン) この日時をタイムゾーンと組み合わせてZonedDateTimeを作成し、結果が同じ瞬間になるようにします。 |
| 3 | ZonedDateTime atZoneSimilarLocal(ZoneIdゾーン) この日時をタイムゾーンと組み合わせて、同じローカル日時を維持しようとするZonedDateTimeを作成します。 |
| 4 | int compareTo(OffsetDateTime other) この日時を別の日時と比較します。 |
| 5 | boolean equals(Object obj) この日時が別の日時と等しいかどうかを確認します。 |
| 6 | 文字列フォーマット(DateTimeFormatterフォーマッター) 指定されたフォーマッタを使用して、この日時をフォーマットします。 |
| 7 | static OffsetDateTime from(TemporalAccessortemporal) 一時オブジェクトからOffsetDateTimeのインスタンスを取得します。 |
| 8 | int get(TemporalFieldフィールド) この日時から指定されたフィールドの値をintとして取得します。 |
| 9 | int getDayOfMonth() 日フィールドを取得します。 |
| 10 | DayOfWeek getDayOfWeek() 列挙型DayOfWeekである曜日フィールドを取得します。 |
| 11 | int getDayOfYear() 曜日フィールドを取得します。 |
| 12 | int getHour() 時刻フィールドを取得します。 |
| 13 | long getLong(TemporalFieldフィールド) この日時から指定されたフィールドの値をlongとして取得します。 |
| 14 | 月getMinute() 分フィールドを取得します。 |
| 15 | 月getMonth() 月の列挙型を使用して月のフィールドを取得します。 |
| 16 | int getMonthValue() 1から12までの月のフィールドを取得します。 |
| 17 | int getNano() nano-of-secondフィールドを取得します。 |
| 18 | ZoneOffset getOffset() '+01:00'などのゾーンオフセットを取得します。 |
| 19 | int getSecond() 分秒フィールドを取得します。 |
| 20 | int getYear() 年フィールドを取得します。 |
| 21 | int hashCode() この日時のハッシュコード。 |
| 22 | boolean isAfter(OffsetDateTime other) この日時が指定された日時より後かどうかを確認します。 |
| 23 | boolean isBefore(OffsetDateTime other) この日時が指定された日時より前であるかどうかを確認します。 |
| 24 | boolean isEqual(OffsetDateTime other) この日時が指定された日時と等しいかどうかを確認します。 |
| 25 | boolean isSupported(TemporalFieldフィールド) 指定されたフィールドがサポートされているかどうかを確認します。 |
| 26 | boolean isSupported(TemporalUnit unit) 指定されたユニットがサポートされているかどうかを確認します。 |
| 27 | OffsetDateTimeマイナス(long amountToSubtract、TemporalUnit unit) 指定された金額を差し引いた、この日時のコピーを返します。 |
| 28 | OffsetDateTimeマイナス(TemporalAmountamountToSubtract) 指定された金額を差し引いた、この日時のコピーを返します。 |
| 29 | OffsetDateTime minusDays(long daysToSubtract) 指定された日数を差し引いたこのOffsetDateTimeのコピーを返します。 |
| 30 | OffsetDateTimeマイナス時間(longhoursToSubtract) 指定された時間数を引いたこのOffsetDateTimeのコピーを返します。 |
| 31 | OffsetDateTimeマイナス分(longminutesToSubtract) 指定された分数を差し引いたこのOffsetDateTimeのコピーを返します。 |
| 32 | OffsetDateTimeマイナス月(長いmonthsToSubtract) 指定された月数を差し引いたこのOffsetDateTimeのコピーを返します。 |
| 33 | OffsetDateTimeマイナスナノス(ロングナノス) 指定されたナノ秒数を差し引いた、このOffsetDateTimeのコピーを返します。 |
| 34 | OffsetDateTimeマイナス秒(長い秒) 指定された秒数を引いたこのOffsetDateTimeのコピーを返します。 |
| 35 | OffsetDateTimeマイナス週(長いweeksToSubtract) 指定された週数を差し引いたこのOffsetDateTimeのコピーを返します。 |
| 36 | OffsetDateTimeマイナス年(longyearsToSubtract) 指定された年数を差し引いたこのOffsetDateTimeのコピーを返します。 |
| 37 | static OffsetDateTime now() デフォルトのタイムゾーンでシステムクロックから現在の日時を取得します。 |
| 38 | static OffsetDateTime now(クロッククロック) 指定された時計から現在の日時を取得します。 |
| 39 | static OffsetDateTime now(ZoneId zone) 指定されたタイムゾーンのシステムクロックから現在の日時を取得します。 |
| 40 | static OffsetDateTime of(int年、int月、int dayOfMonth、int時間、int分、int秒、int nanoOfSecond、ZoneOffsetオフセット) 年、月、日、時、分、秒、ナノ秒、およびオフセットからOffsetDateTimeのインスタンスを取得します。 |
| 41 | static OffsetDateTime of(LocalDate date、LocalTime time、ZoneOffset offset) 日付、時刻、およびオフセットからOffsetDateTimeのインスタンスを取得します。 |
| 42 | static OffsetDateTime of(LocalDateTime dateTime、ZoneOffset offset) 日時とオフセットからOffsetDateTimeのインスタンスを取得します。 |
| 43 | static OffsetDateTime ofInstant(インスタントインスタント、ZoneIdゾーン) InstantおよびゾーンIDからOffsetDateTimeのインスタンスを取得します。 |
| 44 | static OffsetDateTime parse(CharSequence text) 2007-12-03T10:15:30などのテキスト文字列からOffsetDateTimeのインスタンスを取得します。 |
| 45 | static OffsetDateTime parse(CharSequence text、DateTimeFormatter formatter) 特定のフォーマッタを使用して、テキスト文字列からOffsetDateTimeのインスタンスを取得します。 |
| 46 | OffsetDateTime plus(long amountToAdd、TemporalUnit unit) 指定された金額が追加されたこの日時のコピーを返します。 |
| 47 | OffsetDateTime plus(TemporalAmount amountToAdd) 指定された金額が追加されたこの日時のコピーを返します。 |
| 48 | OffsetDateTime plusDays(long daysToAdd) 指定された日数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 49 | OffsetDateTime plusHours(long hoursToAdd) 指定された時間数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 50 | OffsetDateTime plusMinutes(long minutesToAdd) 指定された分数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 51 | OffsetDateTime plusMonths(long monthsToAdd) 指定された月数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 52 | OffsetDateTime plusNanos(long nanos) 指定されたナノ秒数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 53 | OffsetDateTime plusSeconds(長い秒) 指定された秒数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 54 | OffsetDateTime plusWeeks(long weeksToAdd) 指定された週数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 55 | OffsetDateTime plusYears(long yearsToAdd) 指定された年数が追加されたこのOffsetDateTimeのコピーを返します。 |
| 56 | 指定されたクエリを使用して、この日時をクエリします。 |
| 57 | ValueRange範囲(TemporalFieldフィールド) 指定されたフィールドの有効な値の範囲を取得します。 |
| 58 | static Comparator インスタントのみに基づいて2つのOffsetDateTimeインスタンスを比較するコンパレータを取得します。 |
| 59 | 長いtoEpochSecond() この日時を1970-01-01T00:00:00Zのエポックからの秒数に変換します。 |
| 60 | インスタントtoInstant() この日時をインスタントに変換します。 |
| 61 | LocalDate toLocalDate() この日時のLocalDate部分を取得します。 |
| 62 | LocalDateTime toLocalDateTime() この日時のLocalDateTime部分を取得します。 |
| 63 | LocalTime toLocalTime() この日時のLocalTime部分を取得します。 |
| 64 | OffsetTime toOffsetTime() この日時のOffsetTime部分を取得します。 |
| 65 | 文字列toString() この日付を2007-12-03T10:15:30のように文字列として出力します。 |
| 66 | ZonedDateTime toZonedDateTime() オフセットをゾーンIDとして使用して、この日時をZonedDateTimeに変換します。 |
| 67 | OffsetDateTimetrectedTo(TemporalUnit unit) 時間を切り捨てたこのOffsetDateTimeのコピーを返します。 |
| 68 | long until(Temporal endExclusive、TemporalUnit unit) 指定された単位で、別の日時までの時間を計算します。 |
| 69 | OffsetDateTime with(TemporalAdjusterアジャスター) この日時の調整されたコピーを返します。 |
| 70 | OffsetDateTime with(TemporalField field、long newValue) 指定されたフィールドが新しい値に設定された、この日時のコピーを返します。 |
| 71 | OffsetDateTime withDayOfMonth(int dayOfMonth) 曜日が変更されたこのOffsetDateTimeのコピーを返します。 |
| 72 | OffsetDateTime withDayOfYear(int dayOfYear) 曜日が変更されたこのOffsetDateTimeのコピーを返します。 |
| 73 | OffsetDateTime withHour(int hour) 時刻が変更されたこのOffsetDateTimeのコピーを返します。 |
| 74 | OffsetDateTime withMinute(int minutes) 分を変更したこのOffsetDateTimeのコピーを返します。 |
| 75 | OffsetDateTime withMonth(int month) 月が変更されたこのOffsetDateTimeのコピーを返します。 |
| 76 | OffsetDateTime withNano(int nanoOfSecond) nano-of-secondが変更されたこのOffsetDateTimeのコピーを返します。 |
| 77 | OffsetDateTime withOffsetSameInstant(ZoneOffsetオフセット) 結果が同じ瞬間になるように、指定されたオフセットを使用してこのOffsetDateTimeのコピーを返します。 |
| 78 | OffsetDateTime withOffsetSameLocal(ZoneOffsetオフセット) 結果が同じローカル日時になるように、指定されたオフセットを使用してこのOffsetDateTimeのコピーを返します。 |
| 79 | OffsetDateTime withSecond(int second) 分秒を変更したこのOffsetDateTimeのコピーを返します。 |
| 80 | OffsetDateTime withYear(int year) 年が変更されたこのOffsetDateTimeのコピーを返します。 |
継承されたメソッド
このクラスは、次のクラスからメソッドを継承します-
- Java.lang.Object