Class DateUtils


  • public class DateUtils
    extends Object
    • Field Detail

      • GMT

        public static final ZoneId GMT
    • Constructor Detail

      • DateUtils

        public DateUtils()
    • Method Detail

      • formatDate

        public static String formatDate​(ZonedDateTime dateTime)
        Format a ZonedDateTime as RFC 1123 date format used in HTTP. The format is DateTimeFormatter.RFC_1123_DATE_TIME.
        Parameters:
        dateTime - The ZonedDateTime to format.
        Returns:
        the dateTime formatted as RFC 1123 compliant string
      • parseDate

        public static ZonedDateTime parseDate​(String dateTime)
        Return an ZonedDateTime parsed from an RFC 1123 compliant string, i.e. having the format DateTimeFormatter.RFC_1123_DATE_TIME.
        Parameters:
        dateTime - the RFC 1123 compliant string to parse.
        Returns:
        the parsed ZonedDateTime