public class PDFDateParser extends Object
This class provides methods for parsing PDF-format date/time strings
into Date
s.
Such date/time strings are typically
retrieved via Document.getAttribute(String)
, using the Document.ATTR_CREATION_DATE
or
Document.ATTR_MOD_DATE
attribute keys.
Modifier and Type | Method and Description |
---|---|
static Date |
parseDateString(String pdfDate)
Parses the provided PDF-format date string into a
Date instance. |
public static final Date parseDateString(String pdfDate)
Date
instance. If the date string is not properly
formatted
(there are some PDF generators that do not output proper dates in their documents), this method will throw
an appropriate exception. If this happens, it is likely that the date string is formatted in a human-readable way
(i.e. Friday, November 14, 2001, etc).pdfDate
- a PDF-format date string, retrieved via Document.getAttribute(String)
ParseException
- if the provided date string is not properly formatted.