public class PDFDateParser
extends java.lang.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 java.util.Date |
parseDateString(java.lang.String pdfDate)
Parses the provided PDF-format date string into a
Date instance. |
public static final java.util.Date parseDateString(java.lang.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)
java.text.ParseException
- if the provided date string is not properly formatted.