Class DateParser


  • public final class DateParser
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DateParser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Date parseDate​(java.lang.String sDate)
      Try to parse a date using as many methods as possible, until one works.
      static java.util.Date parseRFC822Date​(java.lang.String sDate)
      Parse an RFC 822-style date string.
      static java.util.Date parseW3CDate​(java.lang.String sDate)
      Parse a W3C date string.
      • Methods inherited from class java.lang.Object

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

      • DateParser

        public DateParser()
    • Method Detail

      • parseDate

        public static java.util.Date parseDate​(java.lang.String sDate)
        Try to parse a date using as many methods as possible, until one works.
        Parameters:
        sDate - the date string
        Returns:
        the corresponding date, or null if not parseable or if the date string is empty or null
      • parseRFC822Date

        public static java.util.Date parseRFC822Date​(java.lang.String sDate)
        Parse an RFC 822-style date string.
        Parameters:
        sDate - the date string
        Returns:
        the corresponding date, or null if not parseable or if the date string is empty or null
      • parseW3CDate

        public static java.util.Date parseW3CDate​(java.lang.String sDate)
        Parse a W3C date string. Not comprehensive.
        Parameters:
        sDate - the date string
        Returns:
        the corresponding date, or null if not parseable or if the date string is empty or null