|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.PDate
public class PDate
This class defines a standard PDF date. The class will try its best to parse the date format into its component parts. If a date cannot be parsed, a non-standard flag is set to true. In this instance, any of the data accessor methods will return the unparsed string.
PDF defines a standard date format, which closely follows that of the international standard ASN.1 (Abstract Syntax Notation One), defined in ISO/IEC 8824. A date is a string of the form (D:YYYYMMDDHHmmSSOHH'mm') where:
The apostrophe character (') after HH and mm is part of the syntax. All fields after the year are optional. (The prefix D:, although also optional, is strongly recommended.) The default values for MM and DD are both 01; all other numerical fields default to zero values. A plus sign (+) as the value of the O field signifies that local time is later than UT, a minus sign (-) that local time is earlier than UT, and the letter Z that local time is equal to UT. If no UT information is specified, the relationship of the specified time to UT is considered to be unknown. Whether or not the time zone is known, the rest of the date should be specified in local time. For example, December 23, 1998, at 7:52 PM, U.S. Pacific Standard Time, is represented by the string D:199812231952?08'00'
| Field Summary | |
|---|---|
protected static java.text.SimpleDateFormat |
DATE_FORMAT
|
| Constructor Summary | |
|---|---|
PDate(SecurityManager securityManager,
java.lang.String date)
Create a new Date object. |
|
| Method Summary | |
|---|---|
static PDate |
createDate(java.util.Date date)
|
static java.lang.String |
formatDateTime(java.util.Date time)
Formats a date/time according to the PDF specification. |
static java.lang.String |
formatDateTime(java.util.Date time,
java.util.TimeZone tz)
Formats a date/time according to the PDF specification (D:YYYYMMDDHHmmSSOHH'mm'). |
java.lang.String |
getDay()
Gets the day value of the date. |
java.lang.String |
getHour()
Gets the hour value of the date. |
java.lang.String |
getMinute()
Gets the minute value of the date. |
java.lang.String |
getMonth()
Gets the month value of the date. |
java.lang.String |
getSecond()
Gets the second value of the date. |
java.lang.String |
getTimeZoneHour()
Gets the time zone offset hour from GMT. |
java.lang.String |
getTimeZoneMinute()
Gets the time zone offset minute from GMT. |
boolean |
getTimeZoneOffset()
Gets the time zone offset fromm GMT. |
java.lang.String |
getYear()
Gets the year value of the date. |
java.lang.String |
toString()
Returns a decoded string representation of the date object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.text.SimpleDateFormat DATE_FORMAT
| Constructor Detail |
|---|
public PDate(SecurityManager securityManager,
java.lang.String date)
date - date ASCII data.| Method Detail |
|---|
public java.lang.String getYear()
public java.lang.String getMonth()
public java.lang.String getDay()
public java.lang.String getHour()
public java.lang.String getMinute()
public java.lang.String getSecond()
public java.lang.String getTimeZoneHour()
public java.lang.String getTimeZoneMinute()
public boolean getTimeZoneOffset()
public java.lang.String toString()
toString in class java.lang.Object
public static java.lang.String formatDateTime(java.util.Date time,
java.util.TimeZone tz)
time - date/time value to formattz - the time zone
public static java.lang.String formatDateTime(java.util.Date time)
time - date/time value to format
public static PDate createDate(java.util.Date date)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||