public interface AQDate
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();
Modifier and Type | Method and Description |
---|---|
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(java.lang.String timezone)
Returns a new
AQDate instance where time zone is adjusted to the specified value,
without changing the actual UTC time. |
java.lang.String |
format(java.lang.String pattern)
Converts the date to a string according to the specified pattern.
|
java.lang.String |
format(java.lang.String pattern,
java.lang.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.
|
java.util.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
|
java.util.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.
|
int getYear()
int getMonth()
int getDay()
int getHours()
int getMinutes()
int getSeconds()
int getMilliseconds()
long getTimeMilliseconds()
java.util.Date getJavaDate()
Date
valuejava.util.TimeZone getTimeZone()
TimeZone
value.int getTimeZoneOffset()
boolean isInRange(AQDate start, AQDate end)
start
- Interval start.end
- Interval end.boolean isEarlier(AQDate date)
date
- the specified dateboolean isLater(AQDate date)
date
- the specified dateAQDate add(int years, int months, int days, int hours, int minutes, int seconds, int milliseconds)
AQDate
instance which differs by the specified amount of time.years
- the yearsmonths
- the monthsdays
- the dayshours
- the hoursminutes
- the minutesseconds
- the secondsmilliseconds
- the millisecondsAQDate addYears(int years)
AQDate
instance which differs by the number of years.years
- the yearsAQDate addMonths(int months)
AQDate
instance which differs by the number of months.months
- the monthsAQDate addDays(int days)
AQDate
instance which differs by the number of days.days
- the daysAQDate addHours(int hours)
AQDate
instance which differs by the number of hours.hours
- the hoursAQDate addMinutes(int minutes)
AQDate
instance which differs by the number of minutes.minutes
- the minutesAQDate addSeconds(int seconds)
AQDate
instance which differs by the number of seconds.seconds
- the secondsAQDate addMilliseconds(int ms)
AQDate
instance which differs by the number of milliseconds.ms
- the millisecondsAQDate addTimeZoneOffset(int ms)
AQDate
instance which time zone offset differs by
the specified number of milliseconds.ms
- Time zone offset in milliseconds.AQDate convertTimeZone(java.lang.String timezone)
AQDate
instance where time zone is adjusted to the specified value,
without changing the actual UTC time.timezone
- Time zone specification as defined in TimeZone
. Example: "GMT-08:00"java.lang.String format(java.lang.String pattern)
pattern
- Pattern as specified in SimpleDateFormat
.
Example: "yyyy/MM/dd HH.mm.ss"java.lang.String format(java.lang.String pattern, java.lang.Object locale)
pattern
- Pattern as specified in SimpleDateFormat
.
Example: "yyyy/MM/dd HH.mm.ss"locale
- Locale string as specified in Locale
. Example: "en_US"
Copyright © 2019 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.