public class XMPDateTimeImpl extends Object implements XMPDateTime
XMPDateTime. Internally a calendar is used
plus an additional nano seconds field, because Calendar supports only milli
seconds. The nanoSeconds convers only the resolution beyond a milli second.| Constructor and Description |
|---|
XMPDateTimeImpl()
Creates an
XMPDateTime-instance with the current time in the default time
zone. |
XMPDateTimeImpl(Calendar calendar)
Creates an
XMPDateTime-instance from a calendar. |
XMPDateTimeImpl(Date date,
TimeZone timeZone)
Creates an
XMPDateTime-instance from
a Date and a TimeZone. |
XMPDateTimeImpl(String strValue)
Creates an
XMPDateTime-instance from an ISO 8601 string. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object dt) |
Calendar |
getCalendar() |
int |
getDay() |
int |
getHour() |
String |
getISO8601String() |
int |
getMinute() |
int |
getMonth() |
int |
getNanoSecond() |
int |
getSecond() |
TimeZone |
getTimeZone() |
int |
getYear() |
boolean |
hasDate()
This flag is set either by parsing or by setting year, month or day.
|
boolean |
hasTime()
This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.
|
boolean |
hasTimeZone()
This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.
|
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(TimeZone timeZone) |
void |
setYear(int year) |
String |
toString() |
public XMPDateTimeImpl()
XMPDateTime-instance with the current time in the default time
zone.public XMPDateTimeImpl(Calendar calendar)
XMPDateTime-instance from a calendar.calendar - a Calendarpublic XMPDateTimeImpl(Date date, 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 XMPDateTimeImpl(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 int getYear()
getYear in interface XMPDateTimeXMPDateTime.getYear()public void setYear(int year)
setYear in interface XMPDateTimeyear - Sets the yearXMPDateTime.setYear(int)public int getMonth()
getMonth in interface XMPDateTimeXMPDateTime.getMonth()public void setMonth(int month)
setMonth in interface XMPDateTimemonth - Sets the month 1..12XMPDateTime.setMonth(int)public int getDay()
getDay in interface XMPDateTimeXMPDateTime.getDay()public void setDay(int day)
setDay in interface XMPDateTimeday - Sets the day 1..31XMPDateTime.setDay(int)public int getHour()
getHour in interface XMPDateTimeXMPDateTime.getHour()public void setHour(int hour)
setHour in interface XMPDateTimehour - Sets the hour in the range 0..23.XMPDateTime.setHour(int)public int getMinute()
getMinute in interface XMPDateTimeXMPDateTime.getMinute()public void setMinute(int minute)
setMinute in interface XMPDateTimeminute - Sets the minute in the range 0..59.XMPDateTime.setMinute(int)public int getSecond()
getSecond in interface XMPDateTimeXMPDateTime.getSecond()public void setSecond(int second)
setSecond in interface XMPDateTimesecond - Sets the second in the range 0..59.XMPDateTime.setSecond(int)public int getNanoSecond()
getNanoSecond in interface XMPDateTimeXMPDateTime.getNanoSecond()public void setNanoSecond(int nanoSecond)
setNanoSecond in interface XMPDateTimenanoSecond - Sets the milli-, micro- and nano seconds.
Granularity goes down to milli seconds.XMPDateTime.setNanoSecond(int)public int compareTo(Object dt)
compareTo in interface ComparableComparable.compareTo(Object)public TimeZone getTimeZone()
getTimeZone in interface XMPDateTimeXMPDateTime.getTimeZone()public void setTimeZone(TimeZone timeZone)
setTimeZone in interface XMPDateTimetimeZone - a time zone to setXMPDateTime.setTimeZone(TimeZone)public boolean hasDate()
XMPDateTimehasDate in interface XMPDateTimeXMPDateTime.hasDate()public boolean hasTime()
XMPDateTimehasTime in interface XMPDateTimeXMPDateTime.hasTime()public boolean hasTimeZone()
XMPDateTimehasTimeZone in interface XMPDateTimeXMPDateTime.hasTimeZone()public Calendar getCalendar()
getCalendar in interface XMPDateTimeCalendar (only with milli second precision). XMPDateTime.getCalendar()public String getISO8601String()
getISO8601String in interface XMPDateTimeXMPDateTime.getISO8601String()Copyright © 2020. All rights reserved.