クラス
java.time.LocalDateTimeの使用
LocalDateTimeを使用するパッケージ
パッケージ
説明
Javaプログラミング言語を使用して、データ・ソース(通常はリレーショナル・データベース)に格納されているデータにアクセスして処理するためのAPIを提供します。
日付、時間、インスタント、デュレーションのメインAPI。
デフォルトのISO暦以外の暦体系の汎用API。
タイムゾーンおよびそのルールのサポート。
標準のZIPおよびGZIPファイル形式の読み込みおよび書込み用クラスを提供します。
-
java.sqlでのLocalDateTimeの使用
LocalDateTimeを返すjava.sqlのメソッド型LocalDateTimeのパラメータを持つjava.sqlのメソッド修飾子と型メソッド説明static TimestampTimestamp.valueOf(LocalDateTime dateTime) 指定されたLocalDateTimeと同じ年、月、「月の日」、時、分、秒、およびナノ秒の日付/時間値を持つTimestampのインスタンスをLocalDateTimeオブジェクトから取得します。 -
java.timeでのLocalDateTimeの使用
LocalDateTimeとして宣言されたjava.timeのフィールド修飾子と型フィールド説明static final LocalDateTimeLocalDateTime.MAXサポートされている最大のLocalDateTimeである「+999999999-12-31T23:59:59.999999999」。static final LocalDateTimeLocalDateTime.MINサポートされている最小のLocalDateTimeである「-999999999-01-01T00:00:00」。LocalDateTimeを返すjava.timeのメソッド修飾子と型メソッド説明この時間を日付と組み合せてLocalDateTimeを作成します。LocalDate.atStartOfDay()この日付を深夜零時と組み合せて、この日付の開始時のLocalDateTimeを作成します。LocalDate.atTime(int hour, int minute) この日付を時間と組み合せてLocalDateTimeを作成します。LocalDate.atTime(int hour, int minute, int second) この日付を時間と組み合せてLocalDateTimeを作成します。LocalDate.atTime(int hour, int minute, int second, int nanoOfSecond) この日付を時間と組み合せてLocalDateTimeを作成します。この日付を時間と組み合せてLocalDateTimeを作成します。static LocalDateTimeLocalDateTime.from(TemporalAccessor temporal) 時間的オブジェクトからLocalDateTimeのインスタンスを取得します。LocalDateTime.minus(long amountToSubtract, TemporalUnit unit) 指定された量を減算した、この日付/時間のコピーを返します。LocalDateTime.minus(TemporalAmount amountToSubtract) 指定された量を減算した、この日付/時間のコピーを返します。LocalDateTime.minusDays(long days) 指定された日数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusHours(long hours) 指定された時間数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusMinutes(long minutes) 指定された分数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusMonths(long months) 指定された月数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusNanos(long nanos) 指定されたナノ秒数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusSeconds(long seconds) 指定された秒数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusWeeks(long weeks) 指定された週数を減算して、このLocalDateTimeのコピーを返します。LocalDateTime.minusYears(long years) 指定された年数を減算して、このLocalDateTimeのコピーを返します。static LocalDateTimeLocalDateTime.now()デフォルトのタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static LocalDateTime指定されたクロックから現在の日付/時間を取得します。static LocalDateTime指定されたタイムゾーンのシステム・クロックから現在の日付/時間を取得します。static LocalDateTimeLocalDateTime.of(int year, int month, int dayOfMonth, int hour, int minute) 秒およびナノ秒をゼロに設定して、年、月、日、時、および分からLocalDateTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second) ナノ秒をゼロに設定して、年、月、日、時、分、および秒からLocalDateTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) 年、月、日、時、分、秒、およびナノ秒からLocalDateTimeのインスタンスを取得します。static LocalDateTime秒およびナノ秒をゼロに設定して、年、月、日、時、および分からLocalDateTimeのインスタンスを取得します。static LocalDateTimeナノ秒をゼロに設定して、年、月、日、時、分、および秒からLocalDateTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.of(int year, Month month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) 年、月、日、時、分、秒、およびナノ秒からLocalDateTimeのインスタンスを取得します。static LocalDateTime日付と時間からLocalDateTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset offset) エポック(1970-01-01T00:00:00Z)からの秒数を使用して、LocalDateTimeのインスタンスを取得します。static LocalDateTimeInstantおよびゾーンIDからLocalDateTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.parse(CharSequence text) 2007-12-03T10:15:30などのテキスト文字列からLocalDateTimeのインスタンスを取得します。static LocalDateTimeLocalDateTime.parse(CharSequence text, DateTimeFormatter formatter) 特定のフォーマッタを使用して、テキスト文字列からLocalDateTimeのインスタンスを取得します。LocalDateTime.plus(long amountToAdd, TemporalUnit unit) この日時のコピーに指定された時間を追加したものを返します。LocalDateTime.plus(TemporalAmount amountToAdd) この日時のコピーに指定された時間を追加したものを返します。LocalDateTime.plusDays(long days) 指定された日数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusHours(long hours) 指定された時間数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusMinutes(long minutes) 指定された分数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusMonths(long months) 指定された月数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusNanos(long nanos) 指定されたナノ秒数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusSeconds(long seconds) 指定された秒数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusWeeks(long weeks) 指定された週数を加算して、このLocalDateTimeのコピーを返します。LocalDateTime.plusYears(long years) 指定された年数を加算して、このLocalDateTimeのコピーを返します。OffsetDateTime.toLocalDateTime()この日付/時間のLocalDateTime部分を取得します。ZonedDateTime.toLocalDateTime()この日付/時間のLocalDateTime部分を取得します。LocalDateTime.truncatedTo(TemporalUnit unit) 時間が切り捨てられた、このLocalDateTimeのコピーを返します。LocalDateTime.with(TemporalAdjuster adjuster) この日付/時間の調整済のコピーを返します。LocalDateTime.with(TemporalField field, long newValue) 指定されたフィールドを新しい値に設定して、この日付/時間のコピーを返します。LocalDateTime.withDayOfMonth(int dayOfMonth) 「月の日」を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withDayOfYear(int dayOfYear) 「年の日」を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withHour(int hour) 時の値を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withMinute(int minute) 分の値を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withMonth(int month) 月を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withNano(int nanoOfSecond) ナノ秒の値を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withSecond(int second) 秒の値を変更して、このLocalDateTimeのコピーを返します。LocalDateTime.withYear(int year) 年を変更して、このLocalDateTimeのコピーを返します。型LocalDateTimeのパラメータを持つjava.timeのメソッド修飾子と型メソッド説明static OffsetDateTimeOffsetDateTime.of(LocalDateTime dateTime, ZoneOffset offset) 日付/時間およびオフセットからOffsetDateTimeのインスタンスを取得します。static ZonedDateTimeZonedDateTime.of(LocalDateTime localDateTime, ZoneId zone) ローカル日付/時間から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のインスタンスを取得します。 -
java.time.chronoでのLocalDateTimeの使用
LocalDateTimeを返すjava.time.chronoのメソッド修飾子と型メソッド説明IsoChronology.localDateTime(TemporalAccessor temporal) 別の日付/時間オブジェクトからISO暦のローカル日付/時間を取得します。 -
java.time.zoneでのLocalDateTimeの使用
LocalDateTimeを返すjava.time.zoneのメソッド修飾子と型メソッド説明ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime, ZoneOffset standardOffset, ZoneOffset wallOffset) 指定されたローカル日付/時間を、実際に壁掛け時計に見られるようなローカル日付/時間に変換します。ZoneOffsetTransition.getDateTimeAfter()後オフセットで表現されるような、ローカル遷移日付/時間を取得します。ZoneOffsetTransition.getDateTimeBefore()前オフセットで表現されるような、ローカル遷移日付/時間を取得します。型LocalDateTimeのパラメータを持つjava.time.zoneのメソッド修飾子と型メソッド説明ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime, ZoneOffset standardOffset, ZoneOffset wallOffset) 指定されたローカル日付/時間を、実際に壁掛け時計に見られるようなローカル日付/時間に変換します。ZoneRules.getOffset(LocalDateTime localDateTime) これらのルールで、指定されたローカル日付/時間に適したオフセットを取得します。ZoneRules.getTransition(LocalDateTime localDateTime) これらのルールで、指定されたローカル日付/時間に適用できるオフセット遷移を取得します。ZoneRules.getValidOffsets(LocalDateTime localDateTime) これらのルールで指定されたローカル日付/時間に適用できるオフセットを取得します。booleanZoneRules.isValidOffset(LocalDateTime localDateTime, ZoneOffset offset) オフセット日付/時間がこれらのルールに対して有効であるかどうかを確認します。static ZoneOffsetTransitionZoneOffsetTransition.of(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter) 2つのオフセット間の遷移を定義するインスタンスを取得します。 -
java.util.zipでのLocalDateTimeの使用
LocalDateTimeを返すjava.util.zipのメソッド型LocalDateTimeのパラメータを持つjava.util.zipのメソッド