XMPDateTime
Date: 2012-05-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.adobe.xmp
Interface XMPDateTime

All Superinterfaces:
  java.lang.Comparable

    public interface XMPDateTime

extends java.lang.Comparable

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.
- timeZone - a `TimeZone`-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).

Method Summary
`java.util.Calendar` | `getCalendar()`
`int` | `getDay()`
`int` | `getHour()`
`java.lang.String` | `getISO8601String()`
`int` | `getMinute()`
`int` | `getMonth()`
`int` | `getNanoSecond()`
`int` | `getSecond()`
`java.util.TimeZone` | `getTimeZone()`
`int` | `getYear()`
`boolean` | `hasDate()` This flag is set either by parsing or by setting year, month or day.
`boolean` | `hasTime()` This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.
`boolean` | `hasTimeZone()` This flag is set either by parsing or by setting hours, minutes, seconds or milliseconds.
`void` | `setDay(int day)`
`void` | `setHour(int hour)`
`void` | `setMinute(int minute)`
`void` | `setMonth(int month)`
`void` | `setNanoSecond(int nanoSecond)`
`void` | `setSecond(int second)`
`void` | `setTimeZone(java.util.TimeZone tz)`
`void` | `setYear(int year)`

Methods inherited from interface java.lang.Comparable
`compareTo`

Method Detail

### getYear

    int getYear()

  Returns:
    Returns the year, can be negative.

### setYear

    void setYear(int year)

  Parameters:
    `year` - Sets the year

### getMonth

    int getMonth()

  Returns:
    Returns The month in the range 1..12.

### setMonth

    void setMonth(int month)

  Parameters:
    `month` - Sets the month 1..12

### getDay

    int getDay()

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

### setDay

    void setDay(int day)

  Parameters:
    `day` - Sets the day 1..31

### getHour

    int getHour()

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

### setHour

    void setHour(int hour)

  Parameters:
    `hour` - Sets the hour in the range 0..23.

### getMinute

    int getMinute()

  Returns:
    Returns the minute in the range 0..59.

### setMinute

    void setMinute(int minute)

  Parameters:
    `minute` - Sets the minute in the range 0..59.

### getSecond

    int getSecond()

  Returns:
    Returns the second in the range 0..59.

### setSecond

    void setSecond(int second)

  Parameters:
    `second` - Sets the second in the range 0..59.

### getNanoSecond

    int getNanoSecond()

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

### setNanoSecond

    void setNanoSecond(int nanoSecond)

  Parameters:
    `nanoSecond` - Sets the milli-, micro- and nano seconds. Granularity goes down to milli seconds.

### getTimeZone

    java.util.TimeZone getTimeZone()

  Returns:
    Returns the time zone.

### setTimeZone

    void setTimeZone(java.util.TimeZone tz)

  Parameters:
    `tz` - a time zone to set

### hasDate

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

### hasTime

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

### hasTimeZone

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

### getCalendar

    java.util.Calendar 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.

### getISO8601String

    java.lang.String getISO8601String()

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2007 Adobe Systems Inc. All Rights Reserved.