com.snowtide.pdf
Class PDFDateParser

java.lang.Object
  extended by com.snowtide.pdf.PDFDateParser

public class PDFDateParser
extends java.lang.Object

This class provides methods for parsing PDF-format date/time strings into java.util.Date objects.

Such date/time strings are typically retrieved from a PDFTextStream instance using the PDFTextStream.getAttribute(String) method, using the PDFTextStream.ATTR_CREATION_DATE or PDFTextStream.ATTR_MOD_DATE attribute keys.

Version:
©2004-2012 Snowtide Informatics Systems, Inc.

Method Summary
static java.util.Date parseDateString(java.lang.String pdfDate)
          Parses the provided PDF-format date string into a java.util.Date instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseDateString

public static final java.util.Date parseDateString(java.lang.String pdfDate)
                                            throws java.text.ParseException
Parses the provided PDF-format date string into a java.util.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).

Parameters:
pdfDate - - a PDF-format date string, retrieved via the getAttribute(String) method.
Throws:
java.text.ParseException - - if the provided date string is not properly formatted.