Table of Contents

Interface XMPDateTime

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

The XMPDateTime-class represents a point in time up to a resolution of nano seconds.

public interface XMPDateTime : IComparable
Inherited Members

Remarks

The 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:

  • month - The month in the range 1..12.
  • day - The day of the month in the range 1..31.
  • minute - The minute in the range 0..59.
  • hour - The time zone hour in the range 0..23.
  • minute - The time zone minute in the range 0..59.
  • nanoSecond - The nano seconds within a second. Note: if the XMPDateTime is converted into a calendar, the resolution is reduced to milli seconds.
  • timeZoneInfo - a
    TimeZoneInfo
    -object.
DateTime values are occasionally used in cases with only a date or only a time component. A date without a time has zeros for all the time fields. A time without a date has zeros for all date fields (year, month, and day).

Methods

GetCalendar()

XMPCalendar GetCalendar()

Returns

XMPCalendar

Returns a

Calendar
(only with milli second precision).
Note: the dates before Oct 15th 1585 (which normally fall into validity of the Julian calendar) are also rendered internally as Gregorian dates.

GetDay()

int GetDay()

Returns

int

Returns the day of the month in the range 1..31.

GetHour()

int GetHour()

Returns

int

Returns hour - The hour in the range 0..23.

GetIso8601String()

string GetIso8601String()

Returns

string

Returns the ISO 8601 string representation of the date and time.

GetMinute()

int GetMinute()

Returns

int

Returns the minute in the range 0..59.

GetMonth()

int GetMonth()

Returns

int

Returns The month in the range 1..12.

GetNanoSecond()

int GetNanoSecond()

Returns

int

Returns milli-, micro- and nano seconds. Nanoseconds within a second, often left as zero?

GetSecond()

int GetSecond()

Returns

int

Returns the second in the range 0..59.

GetTimeZone()

TimeZoneInfo GetTimeZone()

Returns

TimeZoneInfo

Returns the time zone.

GetYear()

int GetYear()

Returns

int

Returns the year, can be negative.

HasDate()

This flag is set either by parsing or by setting year, month or day.

bool HasDate()

Returns

bool

Returns true if the XMPDateTime object has a date portion.

HasTime()

This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.

bool HasTime()

Returns

bool

Returns true if the XMPDateTime object has a time portion.

HasTimeZone()

This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.

bool HasTimeZone()

Returns

bool

Returns true if the XMPDateTime object has a defined timezone.

SetDay(int)

void SetDay(int day)

Parameters

day int

Sets the day 1..31

SetHour(int)

void SetHour(int hour)

Parameters

hour int

Sets the hour in the range 0..23.

SetMinute(int)

void SetMinute(int minute)

Parameters

minute int

Sets the minute in the range 0..59.

SetMonth(int)

void SetMonth(int month)

Parameters

month int

Sets the month 1..12

SetNanoSecond(int)

void SetNanoSecond(int nanoSecond)

Parameters

nanoSecond int

Sets the milli-, micro- and nano seconds. Granularity goes down to milli seconds.

SetSecond(int)

void SetSecond(int second)

Parameters

second int

Sets the second in the range 0..59.

SetTimeZone(TimeZoneInfo)

void SetTimeZone(TimeZoneInfo tz)

Parameters

tz TimeZoneInfo

a time zone to set

SetYear(int)

void SetYear(int year)

Parameters

year int

Sets the year