org. helvector. date. Elapsed

Summary
Constructor
Creates on old date by bypassing the date objects restrictions.
Works out if the date is BC.
Calculates the number of days to the end of the year.
Calculates the elapsed number of full days since the start of the year.
Calculates the elapsed number of days since the start of the year.
Calculates the elapsed number of days since the start of the year.
Returns the name of the day for the specified date object
Returns the name of the month in english.
Works out if the date is a leap year.
Returns the number of days in the specified date objects month.
Calculates wether or not the hour of the supplied date object is AM or PM
Turns the hour of specified date object to 12 hour format

Variables

m_in_second

public static var m_in_second: Number

m_in_minute

public static var m_in_minute: Number

m_in_hour

public static var m_in_hour: Number

m_in_day

public static var m_in_day: Number

m_in_year

public static var m_in_year: Number

days

public static var days: Array

months

public static var months: Array

days_in_month

public static var days_in_month: Array

Functions

DateDistance

function Distance()

Constructor

m2_seconds

public static function m2_seconds(m: Number):Number

m2_minutes

public static function m2_minutes(m: Number):Number

m2_hours

public static function m2_hours(m: Number):Number

m2_days

public static function m2_days(m: Number):Number

m2_years

public static function m2_years(m: Number):Number

m2_years_then_minutes

public static function m2_years_then_minutes(m: Number):String

createVeryOldDate

public static function createVeryOldDate(y: Number,
BC: String):Date

Creates on old date by bypassing the date objects restrictions.  (You can’t create a date any earlier that 100AD as the date class defaults to the 1900’s when passed a number below 100.  To do so you need to define the date as a millisecond value and then pass it to the constructor ) This does the job in the usual way.  It looks like the Astrological Calendars used so there is a year 0 and BC dates have a \- in front of them.

Parameters

ythe year as any integer
BCa string as either bc, BC, ad or AD

Returns

A Date object set to the year specified.

isBC

public static function isBC(d: Date):Boolean

Works out if the date is BC.

Parameters

ddate obect

Returns

Boolean.

daysToEndOfYear

public static function daysToEndOfYear(d: Date):Number

Calculates the number of days to the end of the year.

Parameters

Date Object, optional.

Returns

The Number of days to the end of the specified year.

daysToEndOfYearAlt

public static function daysToEndOfYearAlt(d: Date):Number

Calculates the elapsed number of full days since the start of the year.  This uses millisecond subtraction between two known dates and WONT handle dates below 100AD correctly.

Parameters

ddate.

Returns

Number

daysSinceStartOfYear

public static function daysSinceStartOfYear(d: Date):Number

Calculates the elapsed number of days since the start of the year.

Parameters

ddate.

Returns

Number

daysSinceStartOfYearAlt

public static function daysSinceStartOfYearAlt(d: Date):Number

Calculates the elapsed number of days since the start of the year.  This uses millisecond subration between two known dates and won’t handle dates below 100AD correctly.

Parameters

ddate.

Returns

Number

getDayName

public static function getDayName(d: Date):String

Returns the name of the day for the specified date object

Parameters

ddate

Returns

Day of the week as a name (in english)

getMonthName

public static function getMonthName(d: Date):String

Returns the name of the month in english.

Parameters

dinstance of date object.

Returns

Name of the month as string.

leapYear

public static function leapYear(d: Date):Boolean

Works out if the date is a leap year.

Parameters

ddate

Returns

Boolean.  True if it is a leap year, false if not.

getDaysInMonth

public static function getDaysInMonth(d: Date):Number

Returns the number of days in the specified date objects month.

Parameters

ddate.

Returns

Number.

getAMPM

public static function getAMPM(d: Date):String

Calculates wether or not the hour of the supplied date object is AM or PM

Parameters

ddate

Returns

String “AM” or “PM”

getTwelveHour

public static function getTwelveHour(d: Date):Number

Turns the hour of specified date object to 12 hour format

Parameters

ddate

Returns

Number in 12 hour clock format. ie 14 becomes 2, 23 becomes 11.

public static var m_in_second: Number
public static var m_in_minute: Number
public static var m_in_hour: Number
public static var m_in_day: Number
public static var m_in_year: Number
public static var days: Array
public static var months: Array
public static var days_in_month: Array
function Distance()
Constructor
public static function m2_seconds(m: Number):Number
public static function m2_minutes(m: Number):Number
public static function m2_hours(m: Number):Number
public static function m2_days(m: Number):Number
public static function m2_years(m: Number):Number
public static function m2_years_then_minutes(m: Number):String
public static function createVeryOldDate(y: Number,
BC: String):Date
Creates on old date by bypassing the date objects restrictions.
public static function isBC(d: Date):Boolean
Works out if the date is BC.
public static function daysToEndOfYear(d: Date):Number
Calculates the number of days to the end of the year.
public static function daysToEndOfYearAlt(d: Date):Number
Calculates the elapsed number of full days since the start of the year.
public static function daysSinceStartOfYear(d: Date):Number
Calculates the elapsed number of days since the start of the year.
public static function daysSinceStartOfYearAlt(d: Date):Number
Calculates the elapsed number of days since the start of the year.
public static function getDayName(d: Date):String
Returns the name of the day for the specified date object
public static function getMonthName(d: Date):String
Returns the name of the month in english.
public static function leapYear(d: Date):Boolean
Works out if the date is a leap year.
public static function getDaysInMonth(d: Date):Number
Returns the number of days in the specified date objects month.
public static function getAMPM(d: Date):String
Calculates wether or not the hour of the supplied date object is AM or PM
public static function getTwelveHour(d: Date):Number
Turns the hour of specified date object to 12 hour format