Summary: Ctors | Methods | Inherited Methods | [Expand All]
public class

# Date

extends Object

java.lang.Object
↳ | com.pdftron.pdf.Date

## Class Overview

The Date class is a utility class used to simplify work with PDF date objects. PDF defines a standard date format, which closely follows international standard ASN.1(Abstract Syntax Notation One), A date is a string of the form (D:YYYYMMDDHHmmSSOHH'mm'); See PDF Reference Manual for details. Date can be associated with a SDF/Cos date string using Date(Obj*) constructor or later using Date::Attach(Obj*) or Date::Update(Obj*) methods. Date keeps a local date/time cache so it is necessary to call Date::Update() method if the changes to the Date should be saved in the attached Cos/SDF string.

## Summary

Public Constructors
| Date() Date default constructor.
| Date(Obj d) Create a Date and initialize it using given Cos/SDF string date object.
| Date(short year, byte month, byte day, byte hour, byte minute, byte second) Create a Date and initialize it using specified parameters.

Public Methods
static Date | __Create(long impl)
long | __GetHandle()
void | attach(Obj d) Attach the Cos/SDF object to the Date.
boolean | equals(Object other)
byte | getDay() Get the day.
byte | getHour() Get the hour.
byte | getMinute() Get the minute.
byte | getMonth() Get the month.
byte | getSecond() Get the second.
byte | getUT() Get the relationship of local time to Universal Time(UT), denoted by one of the characters +, -, or Z
byte | getUTHour() Get the absolute value of the offset from UT in hours(00-23)
byte | getUTMinutes() Get the absolute value of the offset from UT in minutes(00-59)
short | getYear() Get the year.
int | hashCode()
boolean | isValid() Indicates whether the Date is valid(non-null).
void | seUTMinutes(byte ut_minutes)
void | setCurrentTime() Set the current time.
void | setDay(byte day) Set the day.
void | setHour(byte hour) Set the hour.
void | setMinute(byte minute) Set the minute.
void | setMonth(byte month) Set the month.
void | setSecond(byte second) Set the second.
void | setUT(byte ut) Set the relationship of local time to Universal Time(UT),
void | setUTHour(byte ut_hour) Set the absolute value of the offset from UT in hours(00-23)
void | setUTMinutes(byte ut_minutes) Set the absolute value of the offset from UT in minutes(00-59)
void | setYear(short year) Set the year.
boolean | update(Obj d) Saves changes made to the Date object in the attached(or specified) SDF/Cos string.
boolean | update() Saves changes made to the Date object in the attached(or specified) SDF/Cos string.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public Date ()

Date default constructor.

##### Throws

PDFNetException |

#### public Date (Obj d)

Create a Date and initialize it using given Cos/SDF string date object. String date object is attached to this Date.

##### Parameters

d | input string date object

##### Throws

PDFNetException |

#### public Date (short year, byte month, byte day, byte hour, byte minute, byte second)

Create a Date and initialize it using specified parameters. The Date is not attached to any Cos/SDF object.

##### Throws

PDFNetException |

## Public Methods

#### public static Date __Create (long impl)

#### public long __GetHandle ()

#### public void attach (Obj d)

Attach the Cos/SDF object to the Date.

##### Parameters

d | - underlying Cos/SDF object. Must be an SDF::Str containing a PDF date object.

##### Throws

PDFNetException |

#### public boolean equals (Object other)

#### public byte getDay ()

Get the day.

##### Returns

- the day(01-31).

##### Throws

PDFNetException |

#### public byte getHour ()

Get the hour.

##### Returns

- the hour(00-23).

##### Throws

PDFNetException |

#### public byte getMinute ()

Get the minute.

##### Returns

- the minute(00-59).

##### Throws

PDFNetException |

#### public byte getMonth ()

Get the month.

##### Returns

- the month

##### Throws

PDFNetException |

#### public byte getSecond ()

Get the second.

##### Returns

- the second(00-59).

##### Throws

PDFNetException |

#### public byte getUT ()

Get the relationship of local time to Universal Time(UT), denoted by one of the characters +, -, or Z

##### Returns

- The relationship of local time to Universal Time(UT), denoted by one of the characters +, -, or Z

##### Throws

PDFNetException |

#### public byte getUTHour ()

Get the absolute value of the offset from UT in hours(00-23)

##### Returns

- the absolute value of the offset from UT in hours(00-23)

##### Throws

PDFNetException |

#### public byte getUTMinutes ()

Get the absolute value of the offset from UT in minutes(00-59)

##### Returns

- the absolute value of the offset from UT in minutes(00-59)

##### Throws

PDFNetException |

#### public short getYear ()

Get the year.

##### Returns

- the year

##### Throws

PDFNetException |

#### public int hashCode ()

#### public boolean isValid ()

Indicates whether the Date is valid(non-null).

Note: If this method returns false the underlying SDF/Cos object is null and the Date object should be treated as null as well.

##### Returns

- True if this is a valid(non-null) Date; otherwise false.

##### Throws

PDFNetException |

#### public void seUTMinutes (byte ut_minutes)

##### Throws

PDFNetException |

#### public void setCurrentTime ()

Set the current time.

#### public void setDay (byte day)

Set the day.

##### Parameters

day | the new day

##### Throws

PDFNetException |

#### public void setHour (byte hour)

Set the hour.

##### Parameters

hour | the new hour

##### Throws

PDFNetException |

#### public void setMinute (byte minute)

Set the minute.

##### Parameters

minute | the new minute

##### Throws

PDFNetException |

#### public void setMonth (byte month)

Set the month.

##### Parameters

month | the new month

##### Throws

PDFNetException |

#### public void setSecond (byte second)

Set the second.

##### Parameters

second | the new second

##### Throws

PDFNetException |

#### public void setUT (byte ut)

Set the relationship of local time to Universal Time(UT),

##### Parameters

ut | the relationship of local time to Universal Time(UT),

##### Throws

PDFNetException |

#### public void setUTHour (byte ut_hour)

Set the absolute value of the offset from UT in hours(00-23)

##### Parameters

ut_hour | the absolute value of the offset from UT in hours(00-23)

##### Throws

PDFNetException |

#### public void setUTMinutes (byte ut_minutes)

Set the absolute value of the offset from UT in minutes(00-59)

##### Parameters

ut_minutes | the absolute value of the offset from UT in minutes(00-59)

##### Throws

PDFNetException |

#### public void setYear (short year)

Set the year.

##### Parameters

year | the new year

##### Throws

PDFNetException |

#### public boolean update (Obj d)

Saves changes made to the Date object in the attached(or specified) SDF/Cos string.

##### Parameters

d | - an optional parameter indicating a SDF string that should be updated and attached to this Date. If parameter d is NULL or is omitted, update is performed on previously attached Cos/SDF date.

##### Returns

- true, if successful

##### Throws

PDFNetException |

#### public boolean update ()

Saves changes made to the Date object in the attached(or specified) SDF/Cos string.

##### Returns

- true if the attached Cos/SDF string was successfully updated, false otherwise.

##### Throws

PDFNetException |