iText 7 7.1.8 API
iText.Kernel.XMP.XMPDateTime Interface Reference

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

Inheritance diagram for iText.Kernel.XMP.XMPDateTime:
iText.Kernel.XMP.Impl.XMPDateTimeImpl

Public Member Functions

int  GetYear ()
 
Returns
Returns the year, can be negative.

 
void  SetYear (int year)
 
Parameters
year Sets the year

 
int  GetMonth ()
 
Returns
Returns The month in the range 1..12.

 
void  SetMonth (int month)
 
Parameters
month Sets the month 1..12

 
int  GetDay ()
 
Returns
Returns the day of the month in the range 1..31.

 
void  SetDay (int day)
 
Parameters
day Sets the day 1..31

 
int  GetHour ()
 
Returns
Returns hour - The hour in the range 0..23.

 
void  SetHour (int hour)
 
Parameters
hour Sets the hour in the range 0..23.

 
int  GetMinute ()
 
Returns
Returns the minute in the range 0..59.

 
void  SetMinute (int minute)
 
Parameters
minute Sets the minute in the range 0..59.

 
int  GetSecond ()
 
Returns
Returns the second in the range 0..59.

 
void  SetSecond (int second)
 
Parameters
second Sets the second in the range 0..59.

 
int  GetNanoSecond ()
 
void  SetNanoSecond (int nanoSecond)
 
TimeZoneInfo  GetTimeZone ()
 
Returns
Returns the time zone.

 
void  SetTimeZone (TimeZoneInfo tz)
 
Parameters
tz a time zone to set

 
bool  HasDate ()
  This flag is set either by parsing or by setting year, month or day. More...
 
bool  HasTime ()
  This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds. More...
 
bool  HasTimeZone ()
  This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds. More...
 
XMPCalendar  GetCalendar ()
 
String  GetIso8601String ()
 
Returns
Returns the ISO 8601 string representation of the date and time.

 

Detailed Description

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

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).

Member Function Documentation

◆ GetCalendar()

XMPCalendar iText.Kernel.XMP.XMPDateTime.GetCalendar ( )
Returns
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.

Implemented in iText.Kernel.XMP.Impl.XMPDateTimeImpl.

◆ GetNanoSecond()

int iText.Kernel.XMP.XMPDateTime.GetNanoSecond ( )
Returns
Returns milli-, micro- and nano seconds. Nanoseconds within a second, often left as zero?

Implemented in iText.Kernel.XMP.Impl.XMPDateTimeImpl.

◆ HasDate()

bool iText.Kernel.XMP.XMPDateTime.HasDate ( )

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

Returns
Returns true if the XMPDateTime object has a date portion.

Implemented in iText.Kernel.XMP.Impl.XMPDateTimeImpl.

◆ HasTime()

bool iText.Kernel.XMP.XMPDateTime.HasTime ( )

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

Returns
Returns true if the XMPDateTime object has a time portion.

Implemented in iText.Kernel.XMP.Impl.XMPDateTimeImpl.

◆ HasTimeZone()

bool iText.Kernel.XMP.XMPDateTime.HasTimeZone ( )

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

Returns
Returns true if the XMPDateTime object has a defined timezone.

Implemented in iText.Kernel.XMP.Impl.XMPDateTimeImpl.

◆ SetNanoSecond()

void iText.Kernel.XMP.XMPDateTime.SetNanoSecond ( int  nanoSecond )
Parameters
nanoSecond Sets the milli-, micro- and nano seconds. Granularity goes down to milli seconds.

Implemented in iText.Kernel.XMP.Impl.XMPDateTimeImpl.