- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfString
-
- com.itextpdf.text.pdf.PdfDate
-
public class PdfDate extends PdfString
PdfDateis the PDF date object.PDF defines a standard date format. The PDF date format closely follows the format defined by the international standard ASN.1 (Abstract Syntax Notation One, defined in CCITT X.208 or ISO/IEC 8824). A date is a
PdfStringof the form:(D:YYYYMMDDHHmmSSOHH'mm')
This object is described in the 'Portable Document Format Reference Manual version 1.3' section 7.2 (page 183-184)
- See Also:
PdfString,GregorianCalendar
-
-
Field Summary
-
Fields inherited from class com.itextpdf.text.pdf.PdfString
encoding, hexWriting, objGen, objNum, originalValue, value
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Calendardecode(java.lang.String s)Converts a PDF string representing a date into a Calendar.java.lang.StringgetW3CDate()Gives the W3C format of the PdfDate.static java.lang.StringgetW3CDate(java.lang.String d)Gives the W3C format of the PdfDate.-
Methods inherited from class com.itextpdf.text.pdf.PdfString
getBytes, getEncoding, getOriginalBytes, isHexWriting, setHexWriting, toPdf, toString, toUnicodeString
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Method Detail
-
getW3CDate
public java.lang.String getW3CDate()
Gives the W3C format of the PdfDate.- Returns:
- a formatted date
-
getW3CDate
public static java.lang.String getW3CDate(java.lang.String d)
Gives the W3C format of the PdfDate.- Parameters:
d- the date in the format D:YYYYMMDDHHmmSSOHH'mm'- Returns:
- a formatted date
-
decode
public static java.util.Calendar decode(java.lang.String s)
Converts a PDF string representing a date into a Calendar.- Parameters:
s- the PDF string representing a date- Returns:
- a
Calendarrepresenting the date ornullif the string was not a date
-
-