open class DateFormatter : Formatter<Date>
A formatter for java.util.Date types. Allows the configuration of an explicit date pattern and locale.
Author
Keith Donald
Author
Juergen Hoeller
Author
Phillip Webb
Since
3.0
See Also
SimpleDateFormat
DateFormatter()
Create a new default DateFormatter. DateFormatter(pattern: String)
Create a new DateFormatter for the given date pattern. |
open fun parse(text: String, locale: Locale): Date |
|
open fun print(date: Date, locale: Locale): String |
|
open fun setIso(iso: ISO): Unit
Set the ISO format used for this date. |
|
open fun setLenient(lenient: Boolean): Unit
Specify whether or not parsing is to be lenient. Default is false. With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly. |
|
open fun setPattern(pattern: String): Unit
Set the pattern to use to format date values. If not specified, DateFormat's default style will be used. |
|
open fun setStyle(style: Int): Unit
Set the style to use to format date values. If not specified, DateFormat's default style will be used. |
|
open fun setStylePattern(stylePattern: String): Unit
Set the two character to use to format date values. The first character used for the date style, the second is for the time style. Supported characters are
|
|
open fun setTimeZone(timeZone: TimeZone): Unit
Set the TimeZone to normalize the date values into, if any. |