Package org.elasticsearch.common.joda
Class JodaDateFormatter
java.lang.Object
org.elasticsearch.common.joda.JodaDateFormatter
- All Implemented Interfaces:
DateFormatter
-
Method Summary
Modifier and TypeMethodDescriptionboolean
format(TemporalAccessor accessor)
Print the supplied java time accessor in a string based representation according to this formatterformatJoda(org.joda.time.DateTime dateTime)
Return the given JodaDateTime
formatted with this format.formatMillis(long millis)
Return the given millis-since-epoch formatted with this format.int
hashCode()
locale()
Returns the configured locale of the date formatterTry to parse input to a java time TemporalAccessororg.joda.time.DateTime
Parse the given input into a JodaDateTime
.long
parseMillis(String input)
Parse the given input into millis-since-epoch.pattern()
A name based format for this formatter.Create a DateMathParser from the existing formatterwithLocale(Locale locale)
Create a copy of this formatter that is configured to parse dates in the specified localewithYear(int year)
Create a copy of this formatter that is configured to parse dates in the specified time zonezone()
Returns the configured time zone of the date formatter
-
Method Details
-
parse
Description copied from interface:DateFormatter
Try to parse input to a java time TemporalAccessor- Specified by:
parse
in interfaceDateFormatter
- Parameters:
input
- An arbitrary string resembling the string representation of a date or time- Returns:
- The java time object containing the parsed input
-
parseMillis
Description copied from interface:DateFormatter
Parse the given input into millis-since-epoch.- Specified by:
parseMillis
in interfaceDateFormatter
-
parseJoda
Description copied from interface:DateFormatter
Parse the given input into a JodaDateTime
.- Specified by:
parseJoda
in interfaceDateFormatter
-
withZone
Description copied from interface:DateFormatter
Create a copy of this formatter that is configured to parse dates in the specified time zone- Specified by:
withZone
in interfaceDateFormatter
- Parameters:
zoneId
- The time zone to act on- Returns:
- A copy of the date formatter this has been called on
-
withLocale
Description copied from interface:DateFormatter
Create a copy of this formatter that is configured to parse dates in the specified locale- Specified by:
withLocale
in interfaceDateFormatter
- Parameters:
locale
- The local to use for the new formatter- Returns:
- A copy of the date formatter this has been called on
-
format
Description copied from interface:DateFormatter
Print the supplied java time accessor in a string based representation according to this formatter- Specified by:
format
in interfaceDateFormatter
- Parameters:
accessor
- The temporal accessor used to format- Returns:
- The string result for the formatting
-
formatJoda
Description copied from interface:DateFormatter
Return the given JodaDateTime
formatted with this format.- Specified by:
formatJoda
in interfaceDateFormatter
-
formatMillis
Description copied from interface:DateFormatter
Return the given millis-since-epoch formatted with this format.- Specified by:
formatMillis
in interfaceDateFormatter
-
withYear
-
pattern
Description copied from interface:DateFormatter
A name based format for this formatter. Can be one of the registered formatters likeepoch_millis
or a configured format likeHH:mm:ss
- Specified by:
pattern
in interfaceDateFormatter
- Returns:
- The name of this formatter
-
locale
Description copied from interface:DateFormatter
Returns the configured locale of the date formatter- Specified by:
locale
in interfaceDateFormatter
- Returns:
- The locale of this formatter
-
zone
Description copied from interface:DateFormatter
Returns the configured time zone of the date formatter- Specified by:
zone
in interfaceDateFormatter
- Returns:
- The time zone of this formatter
-
toDateMathParser
Description copied from interface:DateFormatter
Create a DateMathParser from the existing formatter- Specified by:
toDateMathParser
in interfaceDateFormatter
- Returns:
- The DateMathParser object
-
hashCode
public int hashCode() -
equals
-