Class DateUtils


  • public class DateUtils
    extends Object
    Provides utility methods for manipulating with Dates.
    • Field Detail

      • DEFAULT_DATE_FORMAT_MASK

        public static String DEFAULT_DATE_FORMAT_MASK
      • DEFAULT_DATE_AND_TIME_FORMAT_MASK

        public static String DEFAULT_DATE_AND_TIME_FORMAT_MASK
      • DEFAULT_TIME_FORMAT_MASK

        public static String DEFAULT_TIME_FORMAT_MASK
    • Constructor Detail

      • DateUtils

        public DateUtils()
    • Method Detail

      • createDate

        public static Date createDate​(String dateString)
        Creates new Date object using default format - "yyyy-MM-dd" (e.g. 2013-04-25).
        Parameters:
        dateString - string representation of date
        Returns:
        new Date create from string representation
      • createDate

        public static Date createDate​(String dateString,
                                      String dateFormat)
        Creates new Date object from specified date string and date format.
        Parameters:
        dateString - string representation
        dateFormat - format of the date
        Returns:
        new Date create from string representation
      • getDateFormatMask

        public static String getDateFormatMask()
        Check for the system property override, if it isn't exists
      • getDateTimeFormatMask

        public static String getDateTimeFormatMask()
        Check for the system property override, if it isn't exists
      • getDateStr

        public static String getDateStr​(Date date)
      • getDateTimeStr

        public static String getDateTimeStr​(Date date)
      • getPrettyTime

        public static String getPrettyTime​(Date date)