类 DateTimeFormatterFactory

    • 构造器详细资料

      • DateTimeFormatterFactory

        public DateTimeFormatterFactory​(String pattern)
        Create a new DateTimeFormatterFactory instance.
        参数:
        pattern - the pattern to use to format date values
    • 方法详细资料

      • setPattern

        public void setPattern​(String pattern)
        Set the pattern to use to format date values.
        参数:
        pattern - the format pattern
      • setIso

        public void setIso​(DateTimeFormat.ISO iso)
        Set the ISO format used to format date values.
        参数:
        iso - the ISO format
      • setStyle

        public void setStyle​(String style)
        Set the two characters to use to format date values, in Joda-Time style.

        The first character is used for the date style; the second is for the time style. Supported characters are:

        • 'S' = Small
        • 'M' = Medium
        • 'L' = Long
        • 'F' = Full
        • '-' = Omitted
        参数:
        style - two characters from the set {"S", "M", "L", "F", "-"}
      • setTimeZone

        public void setTimeZone​(TimeZone timeZone)
        Set the TimeZone to normalize the date values into, if any.
        参数:
        timeZone - the time zone
      • createDateTimeFormatter

        public DateTimeFormatter createDateTimeFormatter​(DateTimeFormatter fallbackFormatter)
        Create a new DateTimeFormatter using this factory.

        If no specific pattern or style has been defined, the supplied fallbackFormatter will be used.

        参数:
        fallbackFormatter - the fall-back formatter to use when no specific factory properties have been set (can be null).
        返回:
        a new date time formatter