Table of Contents

Class XMPDateTimeFactory

Namespace
iText.Kernel.XMP
Assembly
itext.kernel.dll

A factory to create

XMPDateTime
-instances from a
Calendar
or an ISO 8601 string or for the current time.
public sealed class XMPDateTimeFactory
Inheritance
XMPDateTimeFactory
Inherited Members

Methods

ConvertToLocalTime(XMPDateTime)

Make sure a time is local.

public static XMPDateTime ConvertToLocalTime(XMPDateTime dateTime)

Parameters

dateTime XMPDateTime

the

XMPDateTime
variable containing the time to be modified.

Returns

XMPDateTime

Returns an updated

XMPDateTime
-object.

Remarks

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.

ConvertToUTCTime(XMPDateTime)

Make sure a time is UTC.

public static XMPDateTime ConvertToUTCTime(XMPDateTime dateTime)

Parameters

dateTime XMPDateTime

the

XMPDateTime
variable containing the time to be modified.

Returns

XMPDateTime

Returns an updated

XMPDateTime
-object.

Remarks

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.

Create()

Creates an empty

XMPDateTime
-object.
public static XMPDateTime Create()

Returns

XMPDateTime

Returns an

XMPDateTime
-object.

Create(int, int, int)

Creates an

XMPDateTime
-object from initial values.
public static XMPDateTime Create(int year, int month, int day)

Parameters

year int

years

month int

months from 1 to 12
Note: Remember that the month in DateTime is defined from 0 to 11.

day int

days

Returns

XMPDateTime

Returns an

XMPDateTime
-object.

Create(int, int, int, int, int, int, int)

Creates an

XMPDateTime
-object from initial values.
public static XMPDateTime Create(int year, int month, int day, int hour, int minute, int second, int nanoSecond)

Parameters

year int

years

month int

months from 1 to 12
Note: Remember that the month in DateTime is defined from 0 to 11.

day int

days

hour int

hours

minute int

minutes

second int

seconds

nanoSecond int

nanoseconds

Returns

XMPDateTime

Returns an

XMPDateTime
-object.

CreateFromCalendar(XMPCalendar)

Creates an

XMPDateTime
from a
Calendar
-object.
public static XMPDateTime CreateFromCalendar(XMPCalendar calendar)

Parameters

calendar XMPCalendar

a

Calendar
-object.

Returns

XMPDateTime

An

XMPDateTime
-object.

CreateFromISO8601(string)

Creates an

XMPDateTime
from an ISO 8601 string.
public static XMPDateTime CreateFromISO8601(string strValue)

Parameters

strValue string

The ISO 8601 string representation of the date/time.

Returns

XMPDateTime

An

XMPDateTime
-object.

GetCurrentDateTime()

Obtain the current date and time.

public static XMPDateTime GetCurrentDateTime()

Returns

XMPDateTime

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(XMPDateTime)

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 SetLocalTimeZone(XMPDateTime dateTime)

Parameters

dateTime XMPDateTime

the

XMPDateTime
variable containing the value to be modified.

Returns

XMPDateTime

Returns an updated

XMPDateTime
-object.