Package com.adobe.xmp
Class XMPDateTimeFactory
- java.lang.Object
-
- com.adobe.xmp.XMPDateTimeFactory
-
public final class XMPDateTimeFactory extends java.lang.ObjectA factory to createXMPDateTime-instances from aCalendaror an ISO 8601 string or for the current time.- Since:
- 16.02.2006
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static XMPDateTimeconvertToLocalTime(XMPDateTime dateTime)Make sure a time is local.static XMPDateTimeconvertToUTCTime(XMPDateTime dateTime)Make sure a time is UTC.static XMPDateTimecreate(int year, int month, int day, int hour, int minute, int second, int nanoSecond)Creates anXMPDateTime-object from initial values.static XMPDateTimecreateFromCalendar(java.util.Calendar calendar)Creates anXMPDateTimefrom aCalendar-object.static XMPDateTimecreateFromISO8601(java.lang.String strValue)Creates anXMPDateTimefrom an ISO 8601 string.static XMPDateTimegetCurrentDateTime()Obtain the current date and time.static XMPDateTimesetLocalTimeZone(XMPDateTime dateTime)Sets the local time zone without touching any other Any existing time zone value is replaced, the other date/time fields are not adjusted in any way.
-
-
-
Method Detail
-
createFromCalendar
public static XMPDateTime createFromCalendar(java.util.Calendar calendar)
Creates anXMPDateTimefrom aCalendar-object.- Parameters:
calendar- aCalendar-object.- Returns:
- An
XMPDateTime-object.
-
create
public static XMPDateTime create(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- Returns:
- Returns an
XMPDateTime-object.
-
createFromISO8601
public static XMPDateTime createFromISO8601(java.lang.String strValue) throws XMPException
Creates anXMPDateTimefrom an ISO 8601 string.- Parameters:
strValue- The ISO 8601 string representation of the date/time.- Returns:
- An
XMPDateTime-object. - Throws:
XMPException- When the ISO 8601 string is non-conform
-
getCurrentDateTime
public static XMPDateTime getCurrentDateTime()
Obtain the current date and time.- Returns:
- Returns The returned time is UTC, properly adjusted for the local time zone. The resolution of the time is not guaranteed to be finer than seconds.
-
setLocalTimeZone
public static XMPDateTime setLocalTimeZone(XMPDateTime dateTime)
Sets the local time zone without touching any other Any existing time zone value is replaced, the other date/time fields are not adjusted in any way.- Parameters:
dateTime- theXMPDateTimevariable containing the value to be modified.- Returns:
- Returns an updated
XMPDateTime-object.
-
convertToUTCTime
public static XMPDateTime convertToUTCTime(XMPDateTime dateTime)
Make sure a time is UTC. If the time zone is not UTC, the time is adjusted and the time zone set to be UTC.- Parameters:
dateTime- theXMPDateTimevariable containing the time to be modified.- Returns:
- Returns an updated
XMPDateTime-object.
-
convertToLocalTime
public static XMPDateTime convertToLocalTime(XMPDateTime dateTime)
Make sure a time is local. If the time zone is not the local zone, the time is adjusted and the time zone set to be local.- Parameters:
dateTime- theXMPDateTimevariable containing the time to be modified.- Returns:
- Returns an updated
XMPDateTime-object.
-
-