Class DateTimeFormatUtils


  • public class DateTimeFormatUtils
    extends java.lang.Object
    Utils for Datetime, since locale provider has changed from java 9. (Deprecated) Note: It's recommended to specify the VM option with -Djava.locale.providers=JRE,CLDR. Because it's not only affected to Date Time Format, other Formats may be changed as well.
    Since:
    5.5.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.text.DateFormat getDateFormat​(int style, java.util.Locale locale)
      Returns the conditioned date format according to java version.
      static java.text.DateFormat getDateInstance​(int dateStyle, java.util.Locale locale)  
      static java.text.DateFormat getDateTimeFormat​(int style, int timeStyle, java.util.Locale locale)
      Returns the conditioned datetime format according to java version.
      static java.text.DateFormat getTimeInstance​(int timeStyle, java.util.Locale locale)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateTimeFormatUtils

        public DateTimeFormatUtils()
    • Method Detail

      • getDateInstance

        public static java.text.DateFormat getDateInstance​(int dateStyle,
                                                           java.util.Locale locale)
      • getTimeInstance

        public static java.text.DateFormat getTimeInstance​(int timeStyle,
                                                           java.util.Locale locale)
      • getDateFormat

        public static java.text.DateFormat getDateFormat​(int style,
                                                         java.util.Locale locale)
        Returns the conditioned date format according to java version.
        Parameters:
        style -
        locale -
        Returns:
        dateFormat
      • getDateTimeFormat

        public static java.text.DateFormat getDateTimeFormat​(int style,
                                                             int timeStyle,
                                                             java.util.Locale locale)
        Returns the conditioned datetime format according to java version.
        Parameters:
        style -
        timeStyle -
        locale -
        Returns:
        dateFormat