Interface LocaleDateTimePattern


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:
  • Method Details

    • timePattern

      Optional<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

      Returns:
      a new Builder for a LocaleDateTimePattern.