-
public interface LocaleDateTimePattern
Specifies a locale sensitive numerical date format pattern. Note that the time part is 24 hour based and is not locale sensitive. Orders the year and month parts according to locale, with two-digit month and day parts and two or four digit year.LocaleDateTimePattern pattern = LocaleDateTimePattern.builder() .delimiterDash() .yearFourDigits() .hoursMinutes() .build(); Locale iceland = new Locale("is", "IS"); Locale us = new Locale("en", "US"); pattern.datePattern(iceland); // "dd-MM-yyyy" pattern.datePattern(us); // "MM-dd-yyyy" pattern.dateTimePattern(iceland);// "dd-MM-yyyy HH:mm" pattern.dateTimePattern(us) ;// "MM-dd-yyyy HH:mm"
- See Also:
builder()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
LocaleDateTimePattern.Builder
A Builder forLocaleDateTimePattern
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static LocaleDateTimePattern.Builder
builder()
DateTimeFormatter
createFormatter()
String
datePattern()
String
datePattern(Locale locale)
String
dateTimePattern()
String
dateTimePattern(Locale locale)
String
timePattern()
-
-
-
Method Detail
-
timePattern
String timePattern()
- Returns:
- the time part of this format, null if none is available
-
datePattern
String datePattern()
- Returns:
- the date part of this format using the default Locale
-
dateTimePattern
String dateTimePattern()
- Returns:
- the date and time (if available) parts of this format using the default Locale
-
datePattern
String datePattern(Locale locale)
- Parameters:
locale
- the locale- Returns:
- the date part of this format
-
dateTimePattern
String dateTimePattern(Locale locale)
- Parameters:
locale
- the locale- Returns:
- the date and time (if available) parts of this format
-
createFormatter
DateTimeFormatter createFormatter()
- Returns:
- a new
DateTimeFormatter
instance based on this pattern
-
builder
static LocaleDateTimePattern.Builder builder()
- Returns:
- a new Builder for a
LocaleDateTimePattern
.
-
-