public class XMPDateTime extends java.lang.Object implements java.lang.Comparable<XMPDateTime>
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:
TimeZone
-object.
Constructor and Description |
---|
XMPDateTime()
Creates an
XMPDateTime -instance with the current time in the default time
zone. |
XMPDateTime(java.util.Calendar calendar)
Creates an
XMPDateTime -instance from a calendar. |
XMPDateTime(java.util.Date date,
java.util.TimeZone timeZone)
Creates an
XMPDateTime -instance from
a Date and a TimeZone . |
XMPDateTime(int year,
int month,
int day)
Creates an
XMPDateTime -object from initial values. |
XMPDateTime(int year,
int month,
int day,
int hour,
int minute,
int second,
int nanoSecond)
Creates an
XMPDateTime -object from initial values. |
XMPDateTime(java.lang.String strValue)
Creates an
XMPDateTime -instance from an ISO 8601 string. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(XMPDateTime dt) |
java.util.Calendar |
getCalendar() |
int |
getDay() |
int |
getHour() |
java.lang.String |
getISO8601String() |
int |
getMinute() |
int |
getMonth() |
int |
getNanoSecond() |
int |
getSecond() |
java.util.TimeZone |
getTimeZone() |
int |
getYear() |
boolean |
hasDate() |
boolean |
hasTime() |
boolean |
hasTimeZone() |
void |
setDay(int day) |
void |
setHour(int hour) |
void |
setMinute(int minute) |
void |
setMonth(int month) |
void |
setNanoSecond(int nanoSecond) |
void |
setSecond(int second) |
void |
setTimeZone(java.util.TimeZone timeZone) |
void |
setYear(int year) |
java.lang.String |
toString() |
public XMPDateTime()
XMPDateTime
-instance with the current time in the default time
zone.public XMPDateTime(java.util.Calendar calendar)
XMPDateTime
-instance from a calendar.calendar
- a Calendar
public XMPDateTime(java.util.Date date, java.util.TimeZone timeZone)
XMPDateTime
-instance from
a Date
and a TimeZone
.date
- a date describing an absolute point in timetimeZone
- a TimeZone how to interpret the datepublic XMPDateTime(java.lang.String strValue) throws XMPException
XMPDateTime
-instance from an ISO 8601 string.strValue
- an ISO 8601 stringXMPException
- If the string is a non-conform ISO 8601 string, an exception is thrownpublic XMPDateTime(int year, int month, int day)
XMPDateTime
-object from initial values.year
- yearsmonth
- months from 1 to 12Calendar
is defined from 0 to 11.day
- dayspublic XMPDateTime(int year, int month, int day, int hour, int minute, int second, int nanoSecond)
XMPDateTime
-object from initial values.year
- yearsmonth
- months from 1 to 12Calendar
is defined from 0 to 11.day
- dayshour
- hoursminute
- minutessecond
- secondsnanoSecond
- nanosecondspublic int getYear()
getYear()
public void setYear(int year)
setYear(int)
public int getMonth()
getMonth()
public void setMonth(int month)
setMonth(int)
public int getDay()
getDay()
public void setDay(int day)
setDay(int)
public int getHour()
getHour()
public void setHour(int hour)
setHour(int)
public int getMinute()
getMinute()
public void setMinute(int minute)
setMinute(int)
public int getSecond()
getSecond()
public void setSecond(int second)
setSecond(int)
public int getNanoSecond()
getNanoSecond()
public void setNanoSecond(int nanoSecond)
setNanoSecond(int)
public int compareTo(XMPDateTime dt)
compareTo
in interface java.lang.Comparable<XMPDateTime>
Comparable.compareTo(Object)
public java.util.TimeZone getTimeZone()
getTimeZone()
public void setTimeZone(java.util.TimeZone timeZone)
setTimeZone(TimeZone)
public boolean hasDate()
hasDate()
public boolean hasTime()
hasTime()
public boolean hasTimeZone()
hasTimeZone()
public java.util.Calendar getCalendar()
getCalendar()
public java.lang.String getISO8601String()
getISO8601String()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved