| Method | Defined by | ||
|---|---|---|---|
|
Dates()
Constructor, throws an error if called, as this is an abstract class.
| Dates | ||
|
addDays(d:Date, x:int):Date
[static]
Adds days to a date instance.
| Dates | ||
|
addHours(d:Date, x:int):Date
[static]
Adds hours to a date instance.
| Dates | ||
|
addMinutes(d:Date, x:int):Date
[static]
Adds minutes to a date instance.
| Dates | ||
|
addMonths(d:Date, x:int):Date
[static]
Adds months to a date instance.
| Dates | ||
|
addSeconds(d:Date, x:int):Date
[static]
Adds seconds to a date instance.
| Dates | ||
|
addYears(d:Date, x:int):Date
[static]
Adds years to a date instance.
| Dates | ||
|
roundTime(t:Date, span:int, roundUp:Boolean = false):Date
[static]
Rounds a date according to a particular time span.
| Dates | ||
|
timeSpan(t:Date, s:Date):int
[static]
Given two dates, returns a measure of the time span between them.
| Dates | ||
|
timeStep(span:int):Number
[static]
Returns the number of milliseconds needed to step one time step
forward according to the given time span measure.
| Dates | ||
|
toUTC(d:Date):Date
[static]
Given a date, returns a date instance of the same time in Univeral
Coordinated Time (UTC).
| Dates | ||
| Constant | Defined by | ||
|---|---|---|---|
| DAYS : int = -2 [static] Constant indicating a time span on the order of days.
| Dates | ||
| HOURS : int = -3 [static] Constant indicating a time span on the order of hours.
| Dates | ||
| MILLISECONDS : int = -6 [static] Constant indicating a time span on the order of milliseconds.
| Dates | ||
| MINUTES : int = -4 [static] Constant indicating a time span on the order of minutes.
| Dates | ||
| MONTHS : int = -1 [static] Constant indicating a time span on the order of months.
| Dates | ||
| MS_DAY : Number = 86400000 [static] Number of milliseconds in a day.
| Dates | ||
| MS_HOUR : Number = 3600000 [static] Number of milliseconds in an hours.
| Dates | ||
| MS_MIN : Number = 60000 [static] Number of milliseconds in a minute.
| Dates | ||
| SECONDS : int = -5 [static] Constant indicating a time span on the order of seconds.
| Dates | ||
| WEEKS : int = -10 [static] Constant indicating a time span on the order of weeks.
| Dates | ||
| YEARS : int = 0 [static] Constant indicating a time span of one or more years.
| Dates | ||
| Dates | () | constructor |
public function Dates()Constructor, throws an error if called, as this is an abstract class.
| addDays | () | method |
public static function addDays(d:Date, x:int):DateAdds days to a date instance.
Parametersd:Date — the date
|
|
x:int — the number of days to add (can be negative to subtract)
|
Date — a new Date representing the new date and time
|
| addHours | () | method |
public static function addHours(d:Date, x:int):DateAdds hours to a date instance.
Parametersd:Date — the date
|
|
x:int — the number of hours to add (can be negative to subtract)
|
Date — a new Date representing the new date and time
|
| addMinutes | () | method |
public static function addMinutes(d:Date, x:int):DateAdds minutes to a date instance.
Parametersd:Date — the date
|
|
x:int — the number of minutes to add (can be negative to subtract)
|
Date — a new Date representing the new date and time
|
| addMonths | () | method |
public static function addMonths(d:Date, x:int):DateAdds months to a date instance.
Parametersd:Date — the date
|
|
x:int — the number of months to add (can be negative to subtract)
|
Date — a new Date representing the new date and time
|
| addSeconds | () | method |
public static function addSeconds(d:Date, x:int):DateAdds seconds to a date instance.
Parametersd:Date — the date
|
|
x:int — the number of seconds to add (can be negative to subtract)
|
Date — a new Date representing the new date and time
|
| addYears | () | method |
public static function addYears(d:Date, x:int):DateAdds years to a date instance.
Parametersd:Date — the date
|
|
x:int — the number of years to add (can be negative to subtract)
|
Date — a new Date representing the new date and time
|
| roundTime | () | method |
public static function roundTime(t:Date, span:int, roundUp:Boolean = false):DateRounds a date according to a particular time span. Date values are rounded to the minimum date/time value of the time span (the first day in a year, month, or week, or the beginning of a day, hours, minute, second, etc).
Parameterst:Date — the date to round
|
|
span:int — the time span to which the date should be rounded, legal
values are YEARS, MONTHS, WEEKS, DAYS, HOURS, MINUTES, SECONDS, or
MILLISECONDS
|
|
roundUp:Boolean (default = false) — if true, the date will be rounded up to nearest value,
otherwise it will be rounded down (the default)
|
Date — a new Date representing the rounded date and time.
|
| timeSpan | () | method |
public static function timeSpan(t:Date, s:Date):intGiven two dates, returns a measure of the time span between them.
Parameterst:Date — the first date to compare
|
|
s:Date — the second date to compare
|
int — an integer value indicating the time span between dates. If
the return value is positive, it represents the number of years
between dates. Otherwise, the return value is one of MONTHS, DAYS,
HOURS, MINUTES, SECONDS, or MILLISECONDS.
|
| timeStep | () | method |
public static function timeStep(span:int):NumberReturns the number of milliseconds needed to step one time step forward according to the given time span measure.
Parametersspan:int — the time span for which to return a time step value.
Legal values are any positive numbers (representing years) or DAYS,
HOURS, MINUTES, SECONDS, and MILLISECONDS. Note that the MONTHS
time span is not supported and will result in a zero return value.
|
Number — the number of milliseconds needed to more one time step
ahead according to the input time span. For years (positive
integer input), this step is the nearest power of ten less than the
input value.
|
| toUTC | () | method |
public static function toUTC(d:Date):DateGiven a date, returns a date instance of the same time in Univeral Coordinated Time (UTC).
Parametersd:Date — the date to convert
|
Date |
| DAYS | constant |
public static const DAYS:int = -2Constant indicating a time span on the order of days.
| HOURS | constant |
public static const HOURS:int = -3Constant indicating a time span on the order of hours.
| MILLISECONDS | constant |
public static const MILLISECONDS:int = -6Constant indicating a time span on the order of milliseconds.
| MINUTES | constant |
public static const MINUTES:int = -4Constant indicating a time span on the order of minutes.
| MONTHS | constant |
public static const MONTHS:int = -1Constant indicating a time span on the order of months.
| MS_DAY | constant |
public static const MS_DAY:Number = 86400000Number of milliseconds in a day.
| MS_HOUR | constant |
public static const MS_HOUR:Number = 3600000Number of milliseconds in an hours.
| MS_MIN | constant |
public static const MS_MIN:Number = 60000Number of milliseconds in a minute.
| SECONDS | constant |
public static const SECONDS:int = -5Constant indicating a time span on the order of seconds.
| WEEKS | constant |
public static const WEEKS:int = -10Constant indicating a time span on the order of weeks.
| YEARS | constant |
public static const YEARS:int = 0Constant indicating a time span of one or more years.