OpenAPI 1.0

com.aquafold.openapi.type
Interface AQDate


public interface AQDate

AQDate represents an immutable calendar date value, based on GregorianCalendar.

An instance of this interface can be obtained via one of the newDate() methods in AQDateFactory, or one of the addXXX() methods of AQDate.

Example:
var date = aqua.type.date.newDate(1776,7,4,12,0,0,'GMT-0500'); var now = aqua.type.date.newDate();


Method Summary
 AQDate add(int years, int months, int days, int hours, int minutes, int seconds, int milliseconds)
          Returns a new AQDate instance which differs by the specified amount of time.
 AQDate addDays(int days)
          Returns a new AQDate instance which differs by the number of days.
 AQDate addHours(int hours)
          Returns a new AQDate instance which differs by the number of hours.
 AQDate addMilliseconds(int ms)
          Returns a new AQDate instance which differs by the number of milliseconds.
 AQDate addMinutes(int minutes)
          Returns a new AQDate instance which differs by the number of minutes.
 AQDate addMonths(int months)
          Returns a new AQDate instance which differs by the number of months.
 AQDate addSeconds(int seconds)
          Returns a new AQDate instance which differs by the number of seconds.
 AQDate addTimeZoneOffset(int ms)
          Returns a new AQDate instance which time zone offset differs by the specified number of milliseconds.
 AQDate addYears(int years)
          Returns a new AQDate instance which differs by the number of years.
 AQDate convertTimeZone(String timezone)
          Returns a new AQDate instance where time zone is adjusted to the specified value, without changing the actual UTC time.
 String format(String pattern)
          Converts the date to a string according to the specified pattern.
 String format(String pattern, Object locale)
          Converts the date to a string according to the specified pattern and locale.
 int getDay()
          Returns day of month (1...31) for this date instance.
 int getHours()
          Returns hour of day (0..23) for this date instance.
 Date getJavaDate()
          Returns Date value
 int getMilliseconds()
          Returns the millisecond within the second for this date instance.
 int getMinutes()
          Returns the minute within the hour for this date instance.
 int getMonth()
          Returns month (1..12, January is 1) for this date instance.
 int getSeconds()
          Returns the second within the minute for this date instance.
 long getTimeMilliseconds()
          Returns UTC time in milliseconds since January 1, 1970 00:00:00.000 GMT
 TimeZone getTimeZone()
          Returns TimeZone value.
 int getTimeZoneOffset()
          Returns time zone offset in milliseconds relative to GMT
 int getYear()
          Returns Gregorian year for this date instance.
 boolean isEarlier(AQDate date)
          Returns true if the date is earlier than the specified date.
 boolean isInRange(AQDate start, AQDate end)
          Returns true if the date is within the specified range (inclusive).
 boolean isLater(AQDate date)
          Returns true if the date is later than the specified date.
 

Method Detail

getYear

int getYear()
Returns Gregorian year for this date instance.


getMonth

int getMonth()
Returns month (1..12, January is 1) for this date instance.


getDay

int getDay()
Returns day of month (1...31) for this date instance.


getHours

int getHours()
Returns hour of day (0..23) for this date instance.


getMinutes

int getMinutes()
Returns the minute within the hour for this date instance.


getSeconds

int getSeconds()
Returns the second within the minute for this date instance.


getMilliseconds

int getMilliseconds()
Returns the millisecond within the second for this date instance.


getTimeMilliseconds

long getTimeMilliseconds()
Returns UTC time in milliseconds since January 1, 1970 00:00:00.000 GMT


getJavaDate

Date getJavaDate()
Returns Date value


getTimeZone

TimeZone getTimeZone()
Returns TimeZone value.


getTimeZoneOffset

int getTimeZoneOffset()
Returns time zone offset in milliseconds relative to GMT


isInRange

boolean isInRange(AQDate start,
                  AQDate end)
Returns true if the date is within the specified range (inclusive).

Parameters:
start - Interval start.
end - Interval end.

isEarlier

boolean isEarlier(AQDate date)
Returns true if the date is earlier than the specified date.

Parameters:
date -

isLater

boolean isLater(AQDate date)
Returns true if the date is later than the specified date.

Parameters:
date -

add

AQDate add(int years,
           int months,
           int days,
           int hours,
           int minutes,
           int seconds,
           int milliseconds)
Returns a new AQDate instance which differs by the specified amount of time.

Parameters:
years -
months -
days -
hours -
minutes -
seconds -
milliseconds -

addYears

AQDate addYears(int years)
Returns a new AQDate instance which differs by the number of years.

Parameters:
years -

addMonths

AQDate addMonths(int months)
Returns a new AQDate instance which differs by the number of months.

Parameters:
months -

addDays

AQDate addDays(int days)
Returns a new AQDate instance which differs by the number of days.

Parameters:
days -

addHours

AQDate addHours(int hours)
Returns a new AQDate instance which differs by the number of hours.

Parameters:
hours -

addMinutes

AQDate addMinutes(int minutes)
Returns a new AQDate instance which differs by the number of minutes.

Parameters:
minutes -

addSeconds

AQDate addSeconds(int seconds)
Returns a new AQDate instance which differs by the number of seconds.

Parameters:
seconds -

addMilliseconds

AQDate addMilliseconds(int ms)
Returns a new AQDate instance which differs by the number of milliseconds.

Parameters:
ms - Milliseconds.

addTimeZoneOffset

AQDate addTimeZoneOffset(int ms)
Returns a new AQDate instance which time zone offset differs by the specified number of milliseconds.

Parameters:
ms - Time zone offset in milliseconds.

convertTimeZone

AQDate convertTimeZone(String timezone)
Returns a new AQDate instance where time zone is adjusted to the specified value, without changing the actual UTC time.

Parameters:
timezone - Time zone specification as defined in TimeZone. Example: "GMT-08:00"
Returns:
An AQDate object.
Throws:
Exception - if time zone specified is invalid.

format

String format(String pattern)
Converts the date to a string according to the specified pattern.

Parameters:
pattern - Pattern as specified in SimpleDateFormat. Example: "yyyy/MM/dd HH.mm.ss"
Returns:
A string representation of the AQDate object as specified by the pattern.
Throws:
Exception - If pattern specified is not valid.

format

String format(String pattern,
              Object locale)
Converts the date to a string according to the specified pattern and locale.

Parameters:
pattern - Pattern as specified in SimpleDateFormat. Example: "yyyy/MM/dd HH.mm.ss"
locale - Locale string as specified in Locale. Example: "en_US"
Returns:
A string representation of the AQDate object as specified by the pattern.
Throws:
Exception - If pattern specified is not valid.

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.