public final class XMPDateTimeFactory extends Object
XMPDateTime
-instances from a Calendar
or an ISO 8601 string or for the current time.
Modifier and Type | Method and Description |
---|---|
static XMPDateTime |
convertToLocalTime(XMPDateTime dateTime)
Make sure a time is local.
|
static XMPDateTime |
convertToUTCTime(XMPDateTime dateTime)
Make sure a time is UTC.
|
static XMPDateTime |
create()
Creates an empty XMPDateTime -object.
|
static XMPDateTime |
create(int year, int month, int day)
Creates an XMPDateTime -object from initial values.
|
static XMPDateTime |
create(int year, int month, int day, int hour, int minute, int second, int nanoSecond)
Creates an XMPDateTime -object from initial values.
|
static XMPDateTime |
createFromCalendar(Calendar calendar)
Creates an XMPDateTime from a Calendar -object.
|
static XMPDateTime |
createFromISO8601(String strValue)
Creates an XMPDateTime from an ISO 8601 string.
|
static XMPDateTime |
getCurrentDateTime()
Obtain the current date and time.
|
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.
|
public static XMPDateTime createFromCalendar(Calendar calendar)
XMPDateTime
from a Calendar
-object.
calendar
- a Calendar
-object.
XMPDateTime
-object.
public static XMPDateTime create()
XMPDateTime
-object.
XMPDateTime
-object.
public static XMPDateTime create(int year, int month, int day)
XMPDateTime
-object from initial values.
year
- years
month
- months from 1 to 12
Calendar
is defined from 0 to 11.
day
- days
XMPDateTime
-object.
public static XMPDateTime create(int year, int month, int day, int hour, int minute, int second, int nanoSecond)
XMPDateTime
-object from initial values.
year
- years
month
- months from 1 to 12
Calendar
is defined from 0 to 11.
day
- days
hour
- hours
minute
- minutes
second
- seconds
nanoSecond
- nanoseconds
XMPDateTime
-object.
public static XMPDateTime createFromISO8601(String strValue) throws XMPException
XMPDateTime
from an ISO 8601 string.
strValue
- The ISO 8601 string representation of the date/time.
XMPDateTime
-object.
XMPException
- When the ISO 8601 string is non-conform
public static XMPDateTime getCurrentDateTime()
public static XMPDateTime setLocalTimeZone(XMPDateTime dateTime)
dateTime
- the XMPDateTime
variable containing the value to be modified.
XMPDateTime
-object.
public static XMPDateTime convertToUTCTime(XMPDateTime dateTime)
dateTime
- the XMPDateTime
variable containing the time to be modified.
XMPDateTime
-object.
public static XMPDateTime convertToLocalTime(XMPDateTime dateTime)
dateTime
- the XMPDateTime
variable containing the time to be modified.
XMPDateTime
-object.
Copyright © 1998–2022. All rights reserved.