Class DateUtil

    • Method Detail

      • getCurrentAsString

        public static String getCurrentAsString()
        Returns:
        The current date as a string
      • parseToMilliseconds

        public static long parseToMilliseconds​(String dateValue)
        Parse a given date String to a long representation of the time. Where the provided value is all digits the value is returned as a long, otherwise attempt is made to parse the String as a RFC 1123 date.
        Parameters:
        dateValue - the value to parse.
        Returns:
        the long value following parse, or zero where not successful.
      • parseToRFC1123

        public static String parseToRFC1123​(long dateValue)
        Converts a millisecond representation of a date to a RFC 1123 formatted String.
        Parameters:
        dateValue - the Date represented as milliseconds.
        Returns:
        a String representation of the date.
      • getDateAsString

        public static String getDateAsString​(Date date)
        Convert a given Date object to a RFC 1123 formatted String.
        Parameters:
        date - the Date object to convert
        Returns:
        a String representation of the date.