类 DateTimeContext
java.lang.Object
cn.taketoday.format.datetime.standard.DateTimeContext
A context that holds user-specific
java.time (JSR-310) settings
such as the user's Chronology (calendar system) and time zone.
A null property value indicates the user has not specified a setting.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Return the user's chronology (calendar system), if any.getFormatter(DateTimeFormatter formatter) Get the DateTimeFormatter with this context's settings applied to the baseformatter.Return the user's time zone, if any.voidsetChronology(Chronology chronology) Set the user's chronology (calendar system).voidsetTimeZone(ZoneId timeZone) Set the user's time zone.
-
构造器详细资料
-
DateTimeContext
public DateTimeContext()
-
-
方法详细资料
-
setChronology
Set the user's chronology (calendar system). -
getChronology
Return the user's chronology (calendar system), if any. -
setTimeZone
Set the user's time zone.Alternatively, set a
TimeZoneAwareLocaleContextonLocaleContextHolder. This context class will fall back to checking the locale context if no setting has been provided here.- 另请参阅:
-
LocaleContextHolder.getTimeZone()LocaleContextHolder.setLocaleContext(cn.taketoday.core.i18n.LocaleContext)
-
getTimeZone
Return the user's time zone, if any. -
getFormatter
Get the DateTimeFormatter with this context's settings applied to the baseformatter.- 参数:
formatter- the base formatter that establishes default formatting rules, generally context-independent- 返回:
- the contextual DateTimeFormatter
-