## Date

    Object
       |
       +--Date

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Methods Summary
`Object` | `diff(dateObj)` returns the difference between this and another date object in milliseconds
`Object` | `equals(date, extend)` checks if a date object equals another date object
`Object` | `format(format, locale, timezone)` format a Date to a string
`Object` | `getAge(param)` return the past timespan between this Date object and the current Date or a different Date object
`Object` | `getExpiry(param)` return the future timespan between this Date object and the current Date or a different Date object
`Object` | `getTimespan(param)` return the timespan to current date/time or a different Date object
`void` | `toLocalTime()` set the date/time to local time by adding the timezone offset
`void` | `toUtc()` set the date/time to UTC by subtracting the timezone offset

Method Detail

### diff

    Object diff(dateObj)

returns the difference between this and another date object in milliseconds

### equals

    Object equals(date, extend)

checks if a date object equals another date object

Parameters:

`Object` - Date object to compare

`Int` - indicating how far the comparison should go

Returns:

Boolean

### format

    Object format(format, locale, timezone)

format a Date to a string

Parameters:

`String` - Format pattern

`Object` - Java Locale Object (optional)

`Object` - Java TimeZone Object (optional)

Returns:

String formatted Date

### getAge

    Object getAge(param)

return the past timespan between this Date object and the current Date or a different Date object

See:

- Date.prototype.getTimespan

### getExpiry

    Object getExpiry(param)

return the future timespan between this Date object and the current Date or a different Date object

See:

- Date.prototype.getTimespan

### getTimespan

    Object getTimespan(param)

return the timespan to current date/time or a different Date object

Parameters:

`Object` - parameter object containing optional properties: .now = String to use if difference is < 1 minute .day|days = String to use for single|multiple day(s) .hour|hours = String to use for single|multiple hour(s) .minute|minutes = String to use for single|multiple minute(s) .date = Date object to use for calculating the timespan

Returns:

Object containing properties: .isFuture = (Boolean) .span = (String) timespan

See:

- Date.prototype.getAge, Date.prototype.getExpiry

### toLocalTime

    void toLocalTime()

set the date/time to local time by adding the timezone offset

### toUtc

    void toUtc()

set the date/time to UTC by subtracting the timezone offset

SUMMARY: Constructor | Properties | Methods | DETAIL: Constructor | Properties | Methods

Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007