Class DateFormatUtil


  • public final class DateFormatUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatISO8601​(java.util.Date date, java.util.TimeZone timeZone)
      Formats the date according to ISO 8601 standard.
      static java.lang.String formatPDFDate​(java.util.Date date, java.util.TimeZone timeZone)
      Formats the date according to PDF format.
      static java.util.Date parseISO8601Date​(java.lang.String date)
      Parses an ISO 8601 date and time value.
      • Methods inherited from class java.lang.Object

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

      • formatPDFDate

        public static java.lang.String formatPDFDate​(java.util.Date date,
                                                     java.util.TimeZone timeZone)
        Formats the date according to PDF format. See section 3.8.2 of the PDF 1.4 specification.
        Parameters:
        date - The date time to format
        timeZone - The time zone used to format the date
        Returns:
        a formatted date according to PDF format (based on ISO 8824)
      • formatISO8601

        public static java.lang.String formatISO8601​(java.util.Date date,
                                                     java.util.TimeZone timeZone)
        Formats the date according to ISO 8601 standard.
        Parameters:
        date - The date time to format
        timeZone - The time zone used to format the date
        Returns:
        a formatted date according to ISO 8601
      • parseISO8601Date

        public static java.util.Date parseISO8601Date​(java.lang.String date)
        Parses an ISO 8601 date and time value.
        Parameters:
        date - the date and time value as an ISO 8601 string
        Returns:
        the parsed date/time