Package com.adobe.xmp.core
Class XMPDateTime
java.lang.Object
com.adobe.xmp.core.XMPDateTime
- All Implemented Interfaces:
Comparable<XMPDateTime>
The
XMPDateTime-class represents a point in time up to a resolution of nano
seconds. Dates and time in the serialized XMP are ISO 8601 strings. There are utility functions
to convert to the ISO format, a Calendar or get the Timezone. The fields of
XMPDateTime are:
- month - The month in the range 1..12.
- day - The day of the month in the range 1..31.
- minute - The minute in the range 0..59.
- hour - The time zone hour in the range 0..23.
- minute - The time zone minute in the range 0..59.
- nanoSecond - The nano seconds within a second. Note: if the XMPDateTime is converted into a calendar, the resolution is reduced to milli seconds.
- timeZone - a
TimeZone-object.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates anXMPDateTime-instance with the current time in the default time zone.XMPDateTime(int year, int month, int day) Creates anXMPDateTime-object from initial values.XMPDateTime(int year, int month, int day, int hour, int minute, int second, int nanoSecond) Creates anXMPDateTime-object from initial values.XMPDateTime(String strValue) Creates anXMPDateTime-instance from an ISO 8601 string.XMPDateTime(Calendar calendar) Creates anXMPDateTime-instance from a calendar.XMPDateTime(Date date, TimeZone timeZone) Creates anXMPDateTime-instance from aDateand aTimeZone. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(XMPDateTime dt) intgetDay()intgetHour()intintgetMonth()intintintgetYear()booleanhasDate()booleanhasTime()booleanvoidsetDay(int day) voidsetHour(int hour) voidsetMinute(int minute) voidsetMonth(int month) voidsetNanoSecond(int nanoSecond) voidsetSecond(int second) voidsetTimeZone(TimeZone timeZone) voidsetYear(int year) toString()
-
Constructor Details
-
XMPDateTime
public XMPDateTime()Creates anXMPDateTime-instance with the current time in the default time zone. -
XMPDateTime
Creates anXMPDateTime-instance from a calendar.- Parameters:
calendar- aCalendar
-
XMPDateTime
Creates anXMPDateTime-instance from aDateand aTimeZone.- Parameters:
date- a date describing an absolute point in timetimeZone- a TimeZone how to interpret the date
-
XMPDateTime
Creates anXMPDateTime-instance from an ISO 8601 string.- Parameters:
strValue- an ISO 8601 string- Throws:
XMPException- If the string is a non-conform ISO 8601 string, an exception is thrown
-
XMPDateTime
public XMPDateTime(int year, int month, int day) Creates anXMPDateTime-object from initial values.- Parameters:
year- yearsmonth- months from 1 to 12
Note: Remember that the month inCalendaris defined from 0 to 11.day- days
-
XMPDateTime
public XMPDateTime(int year, int month, int day, int hour, int minute, int second, int nanoSecond) Creates anXMPDateTime-object from initial values.- Parameters:
year- yearsmonth- months from 1 to 12
Note: Remember that the month inCalendaris defined from 0 to 11.day- dayshour- hoursminute- minutessecond- secondsnanoSecond- nanoseconds
-
-
Method Details
-
getYear
public int getYear()- See Also:
-
setYear
public void setYear(int year) - See Also:
-
getMonth
public int getMonth()- See Also:
-
setMonth
public void setMonth(int month) - See Also:
-
getDay
public int getDay()- See Also:
-
setDay
public void setDay(int day) - See Also:
-
getHour
public int getHour()- See Also:
-
setHour
public void setHour(int hour) - See Also:
-
getMinute
public int getMinute()- See Also:
-
setMinute
public void setMinute(int minute) - See Also:
-
getSecond
public int getSecond()- See Also:
-
setSecond
public void setSecond(int second) - See Also:
-
getNanoSecond
public int getNanoSecond()- See Also:
-
setNanoSecond
public void setNanoSecond(int nanoSecond) - See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<XMPDateTime>- See Also:
-
getTimeZone
- See Also:
-
setTimeZone
- See Also:
-
hasDate
public boolean hasDate()- See Also:
-
hasTime
public boolean hasTime()- See Also:
-
hasTimeZone
public boolean hasTimeZone()- See Also:
-
getCalendar
- See Also:
-
getISO8601String
- See Also:
-
toString
-