类 DateTimeFormatterFactory
java.lang.Object
cn.taketoday.format.datetime.standard.DateTimeFormatterFactory
- 直接已知子类:
DateTimeFormatterFactoryBean
Factory that creates a JSR-310
DateTimeFormatter.
Formatters will be created using the defined pattern,
ISO, and xxxStyle methods (considered in that order).
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Phillip Webb, Sam Brannen
- 另请参阅:
-
createDateTimeFormatter()createDateTimeFormatter(DateTimeFormatter)setPattern(java.lang.String)setIso(cn.taketoday.format.annotation.DateTimeFormat.ISO)setDateStyle(java.time.format.FormatStyle)setTimeStyle(java.time.format.FormatStyle)setDateTimeStyle(java.time.format.FormatStyle)DateTimeFormatterFactoryBean
-
构造器概要
构造器构造器说明Create a newDateTimeFormatterFactoryinstance.DateTimeFormatterFactory(String pattern) Create a newDateTimeFormatterFactoryinstance. -
方法概要
修饰符和类型方法说明Create a newDateTimeFormatterusing this factory.createDateTimeFormatter(DateTimeFormatter fallbackFormatter) Create a newDateTimeFormatterusing this factory.voidsetDateStyle(FormatStyle dateStyle) Set the style to use for date types.voidsetDateTimeStyle(FormatStyle dateTimeStyle) Set the style to use for date and time types.voidsetIso(DateTimeFormat.ISO iso) Set the ISO format used to format date values.voidsetPattern(String pattern) Set the pattern to use to format date values.voidsetStylePattern(String style) Set the two characters to use to format date values, in Joda-Time style.voidsetTimeStyle(FormatStyle timeStyle) Set the style to use for time types.voidsetTimeZone(TimeZone timeZone) Set theTimeZoneto normalize the date values into, if any.
-
构造器详细资料
-
DateTimeFormatterFactory
public DateTimeFormatterFactory()Create a newDateTimeFormatterFactoryinstance. -
DateTimeFormatterFactory
Create a newDateTimeFormatterFactoryinstance.- 参数:
pattern- the pattern to use to format date values
-
-
方法详细资料
-
setPattern
Set the pattern to use to format date values.- 参数:
pattern- the format pattern
-
setIso
Set the ISO format used to format date values.- 参数:
iso- the ISO format
-
setDateStyle
Set the style to use for date types. -
setTimeStyle
Set the style to use for time types. -
setDateTimeStyle
Set the style to use for date and time types. -
setStylePattern
Set the two characters to use to format date values, in Joda-Time style.The first character is used for the date style; the second is for the time style. Supported characters are:
- 'S' = Small
- 'M' = Medium
- 'L' = Long
- 'F' = Full
- '-' = Omitted
This method mimics the styles supported by Joda-Time. Note that JSR-310 natively favors
FormatStyleas used forsetDateStyle(java.time.format.FormatStyle),setTimeStyle(java.time.format.FormatStyle)andsetDateTimeStyle(java.time.format.FormatStyle).- 参数:
style- two characters from the set {"S", "M", "L", "F", "-"}
-
setTimeZone
Set theTimeZoneto normalize the date values into, if any.- 参数:
timeZone- the time zone
-
createDateTimeFormatter
Create a newDateTimeFormatterusing this factory.If no specific pattern or style has been defined,
medium date time formatwill be used.- 返回:
- a new date time formatter
- 另请参阅:
-
createDateTimeFormatter
Create a newDateTimeFormatterusing this factory.If no specific pattern or style has been defined, the supplied
fallbackFormatterwill be used.- 参数:
fallbackFormatter- the fall-back formatter to use when no specific factory properties have been set- 返回:
- a new date time formatter
-