spring-framework / org.springframework.format.datetime.joda / JodaTimeContext

JodaTimeContext

open class JodaTimeContext

A context that holds user-specific Joda-Time settings such as the user's Chronology (calendar system) and time zone.

A null property value indicate the user has not specified a setting.

Author
Keith Donald

Since
3.0

See Also
JodaTimeContextHolder

Constructors

<init>

JodaTimeContext()

A context that holds user-specific Joda-Time settings such as the user's Chronology (calendar system) and time zone.

A null property value indicate the user has not specified a setting.

Functions

getChronology

open fun getChronology(): Chronology

Return the user's chronology (calendar system), if any.

getFormatter

open fun getFormatter(formatter: DateTimeFormatter): DateTimeFormatter

Get the DateTimeFormatter with the this context's settings applied to the base formatter.

getTimeZone

open fun getTimeZone(): DateTimeZone

Return the user's time zone, if any.

setChronology

open fun setChronology(chronology: Chronology): Unit

Set the user's chronology (calendar system).

setTimeZone

open fun setTimeZone(timeZone: DateTimeZone): Unit

Set the user's time zone.

Alternatively, set a TimeZoneAwareLocaleContext on LocaleContextHolder. This context class will fall back to checking the locale context if no setting has been provided here.