org.pdfbox.util
Class DateConverter

java.lang.Object
  extended by org.pdfbox.util.DateConverter

public class DateConverter
extends java.lang.Object

This class is used to convert dates to strings and back using the PDF date standards. Date are described in PDFReference1.4 section 3.8.2

Version:
$Revision: 1.13 $
Author:
Ben Litchfield

Method Summary
static java.util.Calendar toCalendar(COSString date)
          This will convert a string to a calendar.
static java.util.Calendar toCalendar(java.lang.String date)
          This will convert a string to a calendar.
static java.lang.String toISO8601(java.util.Calendar cal)
          Convert the date to iso 8601 string format.
static java.lang.String toString(java.util.Calendar date)
          This will convert the calendar to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public static java.lang.String toString(java.util.Calendar date)
This will convert the calendar to a string.

Parameters:
date - The date to convert to a string.
Returns:
The date as a String to be used in a PDF document.

toCalendar

public static java.util.Calendar toCalendar(COSString date)
                                     throws java.io.IOException
This will convert a string to a calendar.

Parameters:
date - The string representation of the calendar.
Returns:
The calendar that this string represents.
Throws:
java.io.IOException - If the date string is not in the correct format.

toCalendar

public static java.util.Calendar toCalendar(java.lang.String date)
                                     throws java.io.IOException
This will convert a string to a calendar.

Parameters:
date - The string representation of the calendar.
Returns:
The calendar that this string represents.
Throws:
java.io.IOException - If the date string is not in the correct format.

toISO8601

public static java.lang.String toISO8601(java.util.Calendar cal)
Convert the date to iso 8601 string format.

Parameters:
cal - The date to convert.
Returns:
The date represented as an ISO 8601 string.