Packagecom.adobe.xmp
Classpublic class XMPDateTime

Represents a date and time value in an XMP Date property. XMP uses rendered dates and times in the ISO8601 format. This class provides conversion methods from and to the JavaScript Date object.



Public Properties
 PropertyDefined by
  day : int
Retrieves the day-of-month value from a date-time.
XMPDateTime
  hour : int
Retrieves the hour value from a date-time.
XMPDateTime
  milliSecond : int
Retrieves the milliseconds value for a time value.
XMPDateTime
  minute : int
Retrieves the minute value from a date-time.
XMPDateTime
  month : int
Retrieves the month value from a date-time.
XMPDateTime
  second : int
Retrieves the second value from a date-time.
XMPDateTime
  timezoneHour : int
[read-only] Retrieves the hours portion of the time-zone offset.
XMPDateTime
  timezoneMinute : int
[read-only] Retrieves the minutes portion of the time-zone offset.
XMPDateTime
  timezoneOffset : int
Retrieves the time-zone offset from a date-time, in minutes.
XMPDateTime
  year : int
Retrieves the year value from a date-time.
XMPDateTime
Public Methods
 MethodDefined by
  
convertDateToISO8601(date:Date, ignoreTZ:Boolean = false):String
[static] Converts a XMPDateTime object to an ISO8601 string value.
XMPDateTime
  
convertISO8601ToDate(iso8601:String):Date
[static] Converts an ISO8601 string value to a XMPDateTime object.
XMPDateTime
  
createFromDate(date:Date, ignoreTZ:Boolean = false):XMPDateTime
[static] Converts a JavaScript Date object to an XMPDateTime object.
XMPDateTime
  
createFromISO8601(iso8601:String):XMPDateTime
[static] Converts an ISO8601 date string to an XMPDateTime object.
XMPDateTime
  
hasTime():Boolean
Checks that the time has been explicitly set with hour, minute, second, and millisecond values.
XMPDateTime
  
hasTimeZone():Boolean
Checks that the time zone has been explicitly set.
XMPDateTime
  
Sets the time-zone value for date-time using the regional settings of the operating system.
XMPDateTime
  
toDate(ignoreTimezone:Boolean = false):Date
Converts this object into a JavaScript-style Date object.
XMPDateTime
  
toISO8601String():String
Converts this XMPDateTime into an ISO 8601 string.
XMPDateTime
  
toString():String
Converts a XMPDateTime object to its string representation.
XMPDateTime
  
toUTCDate():Date
Converts this date-time to universal coordinated time (UTC).
XMPDateTime
Property detail
dayproperty
day:int  [read-write]

Retrieves the day-of-month value from a date-time.

Implementation
    public function get day():int
    public function set day(value:int):void
hourproperty 
hour:int  [read-write]

Retrieves the hour value from a date-time.

Implementation
    public function get hour():int
    public function set hour(value:int):void
milliSecondproperty 
milliSecond:int  [read-write]

Retrieves the milliseconds value for a time value.

Implementation
    public function get milliSecond():int
    public function set milliSecond(value:int):void
minuteproperty 
minute:int  [read-write]

Retrieves the minute value from a date-time.

Implementation
    public function get minute():int
    public function set minute(value:int):void
monthproperty 
month:int  [read-write]

Retrieves the month value from a date-time.

Implementation
    public function get month():int
    public function set month(value:int):void
secondproperty 
second:int  [read-write]

Retrieves the second value from a date-time.

Implementation
    public function get second():int
    public function set second(value:int):void
timezoneHourproperty 
timezoneHour:int  [read-only]

Retrieves the hours portion of the time-zone offset.

Implementation
    public function get timezoneHour():int
timezoneMinuteproperty 
timezoneMinute:int  [read-only]

Retrieves the minutes portion of the time-zone offset.

Implementation
    public function get timezoneMinute():int
timezoneOffsetproperty 
timezoneOffset:int  [read-write]

Retrieves the time-zone offset from a date-time, in minutes.

Implementation
    public function get timezoneOffset():int
    public function set timezoneOffset(value:int):void
yearproperty 
year:int  [read-write]

Retrieves the year value from a date-time.

Implementation
    public function get year():int
    public function set year(value:int):void
Method detail
convertDateToISO8601()method
public static function convertDateToISO8601(date:Date, ignoreTZ:Boolean = false):String

Converts a XMPDateTime object to an ISO8601 string value.

Parameters
date:Date — The Date object.
 
ignoreTZ:Boolean (default = false) — True to ignore the time zone. Default is false

Returns
String — The ISO8601 string value.
convertISO8601ToDate()method 
public static function convertISO8601ToDate(iso8601:String):Date

Converts an ISO8601 string value to a XMPDateTime object.

Parameters
iso8601:String — The date string to convert.

Returns
Date — The Date object.
createFromDate()method 
public static function createFromDate(date:Date, ignoreTZ:Boolean = false):XMPDateTime

Converts a JavaScript Date object to an XMPDateTime object.

Parameters
date:Date — The JavaScript Date object.
 
ignoreTZ:Boolean (default = false) — True to ignore the time zone. Default is false

Returns
XMPDateTime — The new XMPDateTime object.
createFromISO8601()method 
public static function createFromISO8601(iso8601:String):XMPDateTime

Converts an ISO8601 date string to an XMPDateTime object.

Parameters
iso8601:String — The date string.

Returns
XMPDateTime — The new XMPDateTime object.
hasTime()method 
public function hasTime():Boolean

Checks that the time has been explicitly set with hour, minute, second, and millisecond values. The time value 00:00:00 can represent 12:00 am, but is also the default state when no time has been specified. Use this to distinguish a zero-value that has been set, from a zero-value that results from no explicit value having been specified.

Returns
Boolean — True if the time has been explicitly set.
hasTimeZone()method 
public function hasTimeZone():Boolean

Checks that the time zone has been explicitly set. Use this to distinguish a zero-value that has been set, from a zero-value that results from no explicit value having been specified.

Returns
Boolean — True if the time zone has been set explicitly.
setLocalTimezone()method 
public function setLocalTimezone():void

Sets the time-zone value for date-time using the regional settings of the operating system. This must only be called when all other fields are filled in to make sure that daylight saving is respected in the calculation.

toDate()method 
public function toDate(ignoreTimezone:Boolean = false):Date

Converts this object into a JavaScript-style Date object.

Parameters
ignoreTimezone:Boolean (default = false) — True to ignore the time zone. Default is false

Returns
Date — The JavaScript Date object.
toISO8601String()method 
public function toISO8601String():String

Converts this XMPDateTime into an ISO 8601 string. Formats the date according to ISO 8601 and http://www.w3.org/TR/NOTE-datetime:

Data fields:

Note: ISO 8601 does not allow years less than 1000 or greater than 9999. This API allows any year, even negative ones. The year is formatted as "%.4d".

Returns
String — The ISO 8601 string.
toString()method 
public function toString():String

Converts a XMPDateTime object to its string representation.

Returns
String — The date string, formatted according to ISO8601.

See also

toUTCDate()method 
public function toUTCDate():Date

Converts this date-time to universal coordinated time (UTC).

Returns
Date — A new XMPDateTime object.