public class DateTimeContext extends ObjectSE
java.time
(JSR-310)設定を保持するコンテキスト。null
プロパティ値は、ユーザーが設定を指定していないことを示します。DateTimeContextHolder
コンストラクターと説明 |
---|
DateTimeContext() |
修飾子と型 | メソッドと説明 |
---|---|
ChronologySE | getChronology() ユーザーの年代順(カレンダーシステム)を返します(ある場合)。 |
DateTimeFormatterSE | getFormatter(DateTimeFormatterSE formatter) このコンテキストの設定がベース formatter に適用された DateTimeFormatter を取得します。 |
ZoneIdSE | getTimeZone() もしあれば、ユーザーのタイムゾーンを返します。 |
void | setChronology(ChronologySE chronology) ユーザーの年表(カレンダーシステム)を設定します。 |
void | setTimeZone(ZoneIdSE timeZone) ユーザーのタイムゾーンを設定します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public void setChronology(@Nullable ChronologySE chronology)
@Nullable public ChronologySE getChronology()
public void setTimeZone(@Nullable ZoneIdSE timeZone)
または、LocaleContextHolder
に TimeZoneAwareLocaleContext
を設定します。ここで設定が指定されていない場合、このコンテキストクラスはロケールコンテキストのチェックにフォールバックします。
public DateTimeFormatterSE getFormatter(DateTimeFormatterSE formatter)
formatter
に適用された DateTimeFormatter を取得します。formatter
- デフォルトのフォーマットルールを確立する基本フォーマッタ。通常はコンテキストに依存しません