Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DateTime

Epoch abstraction with adjustable coarseness/precision. All date fields in UTC only.

Hierarchy

  • DateTime

Implements

Index

Constructors

constructor

Properties

M

M: number

d

d: number

h

h: number

m

m: number

s

s: number

t

t: number

y

y: number

Accessors

q

  • get q(): number
  • Readonly property, returning 1-based quarter

    remarks
    • 1 = Jan - Mar
    • 2 = Apr - Jun
    • 3 = Jul - Sep
    • 4 = Oct - Dec

    Returns number

w

  • get w(): number

Methods

add

  • Returns a new DateTime instance relative to this date, but with given period added/subtracted.

    Parameters

    Returns DateTime

compare

copy

dayInYear

  • dayInYear(): number

daysInMonth

  • daysInMonth(): number

decDay

  • decDay(): number

decHour

  • decHour(): number

decMillisecond

  • decMillisecond(): number

decMinute

  • decMinute(): number

decMonth

  • decMonth(): number

decQuarter

  • decQuarter(): number

decSecond

  • decSecond(): number

decWeek

  • decWeek(): number

decYear

  • decYear(): number

eqDelta

equiv

  • equiv(o: any): boolean
  • Parameters

    • o: any

    Returns boolean

getTime

  • getTime(): number

incDay

  • incDay(): number

incHour

  • incHour(): number

incMillisecond

  • incMillisecond(): number

incMinute

  • incMinute(): number

incMonth

  • incMonth(): number

incQuarter

  • incQuarter(): number

incSecond

  • incSecond(): number

incWeek

  • incWeek(): number

incYear

  • incYear(): number

isAfter

  • Returns true if this instance is before the given date, i.e. if this.compare(d) > 0.

    Parameters

    Returns boolean

isBefore

  • Returns true if this instance is before the given date, i.e. if this.compare(d) < 0.

    Parameters

    Returns boolean

isLeapYear

  • isLeapYear(): boolean
  • Leap years are multiple of 4, excludingcentennial years that aren’t multiples of 400.

    Returns boolean

set

setPrecision

toDate

  • toDate(): Date

toISOString

  • toISOString(): string

toJSON

  • toJSON(): string

toLocaleString

  • toLocaleString(): string
  • Returns formatted version using current {@link LOCALE.dateTime} formatter.

    remarks

    The host environment's locale is NOT used. Only the currently active LOCALE is relevant.

    Returns string

toString

  • toString(): string

valueOf

  • valueOf(): number

weekInYear

  • weekInYear(): number

withPrecision

Generated using TypeDoc