Schnittstelle DateTimeFormatterInterface
- Alle bekannten Implementierungsklassen:
DateTimeFormatterService
,DateTimeFormatterTool
public interface DateTimeFormatterInterface
-
Feldübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<T extends TemporalAccessor>
Stringformat
(T temporalAccessor) Formats the given datetime as a String with the #DateTimeFormatterService.getDefaultFormat()
.<T extends TemporalAccessor>
StringFormats the given date as a String.<T extends TemporalAccessor>
StringFormats the given date as a String.<T extends TemporalAccessor>
StringFormats the given date as a String.Maps from an incoming format to an outgoing formatDateTimeFormatter
.map
(String src, DateTimeFormatter outgoingFormat, Locale locale) Uses as incomingDateTimeFormatter
getDefaultFormat()
.map
(String src, DateTimeFormatter outgoingFormat, Locale locale, DateTimeFormatter incomingFormat) Uses as incoming formatgetDefaultFormat()
and no locale.mapFrom
(String src, DateTimeFormatter incomingFormat) mapTo
(String src, DateTimeFormatter outgoingFormat) Uses as outgoingDateTimeFormatter
getDefaultFormat()
and no locale.
-
Felddetails
-
DATE_TIME_FORMAT_KEY
Property tag for the date format that is to be used for the web application. "tool.dateTool.format"- Siehe auch:
-
DATE_TIME_ZONEID_KEY
- Siehe auch:
-
USE_TURBINE_LOCALE_KEY
- Siehe auch:
-
USE_REQUEST_LOCALE_KEY
- Siehe auch:
-
DATE_TIME_FORMAT_DEFAULT
Default date format. find supported formats inDateTimeFormatterService
- Siehe auch:
-
-
Methodendetails
-
getDefaultFormat
-
getFormatPattern
-
format
Formats the given datetime as a String with the #DateTimeFormatterService.getDefaultFormat()
. using the default date format.- Parameter:
temporalAccessor
-Ungültige Eingabe: "to format"
- Gibt zurück:
- String value of the date
-
format
Formats the given date as a String.- Parameter:
temporalAccessor
- TimeDate date to formatdateFormatString
- format string to use. SeeDateTimeFormatter
for details.- Gibt zurück:
- String value of the date
-
format
<T extends TemporalAccessor> String format(T temporalAccessor, String dateFormatString, Locale locale) Formats the given date as a String.- Parameter:
temporalAccessor
- TimeDate date to formatdateFormatString
- format string to use. SeeDateTimeFormatter
for details.locale
- used to loclize the format- Gibt zurück:
- String value of the date
-
format
<T extends TemporalAccessor> String format(T temporalAccessor, String dateFormatString, Locale locale, ZoneId zoneId) Formats the given date as a String.- Parameter:
temporalAccessor
- TimeDate date to formatdateFormatString
- format string to use. SeeDateTimeFormatter
for details.locale
- theLocale
zoneId
- theZoneId
- Gibt zurück:
- String value of the date
-
map
Maps from an incoming format to an outgoing formatDateTimeFormatter
.- Parameter:
src
- the formatted datetimeoutgoingFormat
- the outgoingFormat pattern,DateTimeFormatter
locale
- Locale, if needed for outgoing formatting, no default.incomingFormat
- the incming format patternDateTimeFormatter
, optional, default isgetDefaultFormat()
.- Gibt zurück:
- the newly mapped
-
map
String map(String src, DateTimeFormatter outgoingFormat, Locale locale, DateTimeFormatter incomingFormat) Uses as incoming formatgetDefaultFormat()
and no locale.- Parameter:
src
- the text, which will be parsed using the incomingFormat.outgoingFormat
- the outgoing formatter, which will format.locale
- The locale, if not null which will outgoingFormat use,DateTimeFormatter.withLocale(Locale)
.incomingFormat
- the incoming formatter, which will be parsed.- Gibt zurück:
- the formatted string
-
mapTo
Uses as outgoingDateTimeFormatter
getDefaultFormat()
and no locale.- Parameter:
src
- the datetime formatted stringoutgoingFormat
- the format of this string- Gibt zurück:
- the date time formatted
-
mapFrom
- Parameter:
src
- the datetime formatted stringincomingFormat
- the format to which this incoming string should be formatted.- Gibt zurück:
- the newly formatted date time string
-
map
Uses as incomingDateTimeFormatter
getDefaultFormat()
.- Parameter:
src
- the datetime formatted stringoutgoingFormat
- the format to which this string should be formatted.locale
- The locale, if not null,the incomingFormat will use.- Gibt zurück:
- the newly formatted date time string
-
getZoneId
-