Packagecom.adobe.fiber.runtime.lib
Classpublic class DateTimeFunc
InheritanceDateTimeFunc Inheritance Object

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

The DateTimeFunc class defines the implementations of the expression runtime functions for Date and Time functions for the Adobe application modeling language.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
createDate(year:int, month:int, day:int, hour:int, minute:int, second:int):Date
[static] Create a date in the local timezone.
DateTimeFunc
  
createDateUTC(year:int, month:int, day:int, hour:int, minute:int, second:int):Date
[static] Create a date in the UTC timezone.
DateTimeFunc
  
dateAdd(part:String, units:int, date:Date):Date
[static] Add units of time to a date.
DateTimeFunc
  
dateCompare(date1:Date, date2:Date):int
[static] This function takes two dates and returns -1, 0, or 1 depending on whether the first is smaller, equal or larger than the second.
DateTimeFunc
  
dateDiff(part:String, date1:Date, date2:Date):Number
[static] This function takes a String datepart and two Dates and returns an int number of dateparts between the two Dates.
DateTimeFunc
  
datePart(part:String, date:Date):int
[static] This function takes a String datepart and a Date and it returns the int value of that part.
DateTimeFunc
  
[static] This function takes a String datepart and a Date and it returns the int value of that part.
DateTimeFunc
  
[static] This function returns the int day of week value of a Date param.
DateTimeFunc
  
[static] This function returns the day of year corresponding to a date input.
DateTimeFunc
  
[static] This function returns the number of days in a month.
DateTimeFunc
  
[static] This function returns the number of days in a given year.
DateTimeFunc
  
[static] Returns the ordinal (the day's number in the year) for the first day of the specified month.
DateTimeFunc
  
[static] This function returns the int day value of a Date param.
DateTimeFunc
  
[static] This function returns the int day value of a Date param.
DateTimeFunc
  
[static] This function returns the int hour value of a Date param.
DateTimeFunc
  
[static] This function returns the int hour value of a Date param.
DateTimeFunc
  
[static] This function returns the int minute value of a Date param.
DateTimeFunc
  
[static] This function returns the int minute value of a Date param.
DateTimeFunc
  
[static] This function returns the int month value of a Date param.
DateTimeFunc
  
[static] This function returns the int month value of a Date param.
DateTimeFunc
  
[static] This function returns the int quarter value of a Date param.
DateTimeFunc
  
[static] This function returns the int second value of a Date param.
DateTimeFunc
  
[static] This function returns the int second value of a Date param.
DateTimeFunc
  
[static] This function returns the int year value of a Date param.
DateTimeFunc
  
[static] This function returns the int year value of a Date param.
DateTimeFunc
 Inherited
Indicates whether an object has a specified property defined.
Object
  
[static] This function returns a boolean indicating whether a year is a leap year or not.
DateTimeFunc
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
[static] Return the current date and time.
DateTimeFunc
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
[static] Return the current date and time (legacy).
DateTimeFunc
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
  
[static] This function returns the week of the year for a Date.
DateTimeFunc
  
years(endDate:Date, startDate:Date):int
[static] Return the number of years between two dates.
DateTimeFunc
Method Detail
createDate()method
public static function createDate(year:int, month:int, day:int, hour:int, minute:int, second:int):Date

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Create a date in the local timezone.

Parameters

year:int — year
 
month:int — month
 
day:int — day
 
hour:int — hour
 
minute:int — minute
 
second:int — second

Returns
Date — a new date
createDateUTC()method 
public static function createDateUTC(year:int, month:int, day:int, hour:int, minute:int, second:int):Date

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Create a date in the UTC timezone.

Parameters

year:int — year
 
month:int — month
 
day:int — day
 
hour:int — hour
 
minute:int — minute
 
second:int — second

Returns
Date — a new date
dateAdd()method 
public static function dateAdd(part:String, units:int, date:Date):Date

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Add units of time to a date. Units are:

Parameters

part:String — the type of units to add
 
units:int — the number of units
 
date:Date — the date

Returns
Date — a new date; null if date is null
dateCompare()method 
public static function dateCompare(date1:Date, date2:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function takes two dates and returns -1, 0, or 1 depending on whether the first is smaller, equal or larger than the second.

Parameters

date1:Date — first Date for comparison
 
date2:Date — second Date for comparison

Returns
int — int -1 if date1 < date2, 0 if date1=date2, 1 if date1 > date2. Return 0 if either date is null;
dateDiff()method 
public static function dateDiff(part:String, date1:Date, date2:Date):Number

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function takes a String datepart and two Dates and returns an int number of dateparts between the two Dates.

Parameters

part:String — String valid datepart
 
date1:Date — Date first comparison date
 
date2:Date — Date second comparison date

Returns
Number — value representing number of dateparts between date1 and date2. Returns zero if either date is null;

Throws
Error — if bad part
datePart()method 
public static function datePart(part:String, date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function takes a String datepart and a Date and it returns the int value of that part.

Parameters

part:String — String valid date part (yyyy, m, y, d, w, ww, h, n, s)
 
date:Date — for which part should be returned

Returns
int — value representing datepart for given Date. Return zero if date is null.
datePartUTC()method 
public static function datePartUTC(part:String, date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function takes a String datepart and a Date and it returns the int value of that part.

Parameters

part:String — String valid date part (yyyy, m, y, d, w, ww, h, n, s)
 
date:Date — for which part should be returned

Returns
int — value representing datepart for given Date. Return zero if date is null.
dayOfWeek()method 
public static function dayOfWeek(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int day of week value of a Date param.

Parameters

date:Date — for which day of week will be returned

Returns
int — dayofweek of input date. Return -1 if date is null.
dayOfYear()method 
public static function dayOfYear(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the day of year corresponding to a date input.

Parameters

date:Date — for which day of year will be returned

Returns
int — day of year corresponding to date input. Returns -1 if date is null.
daysInMonth()method 
public static function daysInMonth(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the number of days in a month.

Parameters

date:Date — for which number of days in month will be returned

Returns
int — number of days in this month. Return zero if date is null.
daysInYear()method 
public static function daysInYear(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the number of days in a given year.

Parameters

date:Date — for which number of days in year will be returned

Returns
int — the number of days this year. Return zero if date is null.
firstDayOfMonth()method 
public static function firstDayOfMonth(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns the ordinal (the day's number in the year) for the first day of the specified month.

Parameters

date:Date — for which first day of month will be returned

Returns
int — ordinal for the first day of month param. Return zero if date is null.
getDay()method 
public static function getDay(date:Date):int

This function returns the int day value of a Date param.

Parameters

date:Date — for which day will be returned

Returns
int — day of input date. Return zero if date is null.
getDayUTC()method 
public static function getDayUTC(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int day value of a Date param.

Parameters

date:Date — for which day will be returned

Returns
int — day of input date. Return zero if date is null.
getHour()method 
public static function getHour(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int hour value of a Date param.

Parameters

date:Date — for which hour will be returned

Returns
int — hour of input date. Return -1 if date is null.
getHourUTC()method 
public static function getHourUTC(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int hour value of a Date param.

Parameters

date:Date — for which hour will be returned

Returns
int — hour of input date. Return -1 if date is null.
getMinute()method 
public static function getMinute(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int minute value of a Date param.

Parameters

date:Date — for which minute will be returned

Returns
int — minute of input date. Return -1 if date is null.
getMinuteUTC()method 
public static function getMinuteUTC(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int minute value of a Date param.

Parameters

date:Date — for which minute will be returned

Returns
int — minute of input date. Return -1 if date is null.
getMonth()method 
public static function getMonth(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int month value of a Date param.

Parameters

date:Date — for which month will be returned

Returns
int — month of input date. Return 0 of date is null.
getMonthUTC()method 
public static function getMonthUTC(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int month value of a Date param.

Parameters

date:Date — for which month will be returned

Returns
int — month of input date. Return 0 of date is null.
getQuarter()method 
public static function getQuarter(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int quarter value of a Date param.

Parameters

date:Date — for which quarter will be returned

Returns
int — quarter of input date (1-4). Return 0 of date is null.
getSecond()method 
public static function getSecond(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int second value of a Date param.

Parameters

date:Date — for which second will be returned

Returns
int — second of input date. Return -1 of date is null.
getSecondUTC()method 
public static function getSecondUTC(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int second value of a Date param.

Parameters

date:Date — for which second will be returned

Returns
int — second of input date. Return -1 of date is null.
getYear()method 
public static function getYear(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int year value of a Date param.

Parameters

date:Date — for which Year will be returned

Returns
int — year of input date. Return zero of date is null.
getYearUTC()method 
public static function getYearUTC(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the int year value of a Date param.

Parameters

date:Date — for which Year will be returned

Returns
int — year of input date. Return zero of date is null.
isLeapYear()method 
public static function isLeapYear(year:int):Boolean

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns a boolean indicating whether a year is a leap year or not. Known problem -- we differ in logic in years before 1582. (we follow java calendar class).

Parameters

year:int — int year

Returns
Boolean — boolean indicating whether year is a leap year
now()method 
public static function now():Date

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Return the current date and time.

Returns
Date
today()method 
public static function today():Date

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Return the current date and time (legacy).

Returns
Date
weekOfYear()method 
public static function weekOfYear(date:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

This function returns the week of the year for a Date.

Parameters

date:Date — date

Returns
int — week of the year. Return zero of date is null.
years()method 
public static function years(endDate:Date, startDate:Date):int

Language Version: ActionScript 3.0
Product Version: LiveCycle Data Services 3
Runtime Versions: Flash Player 9, AIR 1.1

Return the number of years between two dates.

Parameters

endDate:Date — end date
 
startDate:Date — starting date

Returns
int — the numbers of years between the start and end dates. Return -1 if either date is null.