Hierarchy

Index

Constructors

constructor

  • new DateTime(param1: Date | number, month?: number, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number): DateTime
  • Parameters

    • param1: Date | number
    • Optional month: number
    • Optional day: number
    • Optional hour: number
    • Optional minute: number
    • Optional second: number
    • Optional millisecond: number

    Returns DateTime

Properties

dateTimeOffset

dateTimeOffset: string = ""

Static maxValue

maxValue: DateTime = new DateTime(DateTime.maxTicks)

Static minValue

minValue: DateTime = new DateTime(DateTime.minTicks)

Accessors

date

day

  • get day(): number
  • Returns number

dayName

  • get dayName(): string
  • Returns string

dayOfWeek

  • 0 – Sunday, 1 – Monday etc

    Returns DayOfWeek

dayOfYear

  • get dayOfYear(): number
  • Returns number

dayShortName

  • get dayShortName(): string
  • Returns string

hour

  • get hour(): number
  • Returns number

jsDate

  • get jsDate(): Date
  • Returns Date

millisecond

  • get millisecond(): number
  • Returns number

minute

  • get minute(): number
  • Returns number

month

  • get month(): number
  • Returns number

monthGenitiveName

  • get monthGenitiveName(): string
  • Returns string

monthName

  • get monthName(): string
  • Returns string

monthShortName

  • get monthShortName(): string
  • Returns string

second

  • get second(): number
  • Returns number

ticks

  • get ticks(): number
  • Returns number

timeOfDay

year

  • get year(): number
  • Returns number

Static now

Static today

Methods

addDays

  • Parameters

    • value: number

    Returns DateTime

addHours

  • Parameters

    • value: number

    Returns DateTime

addMilliseconds

  • addMilliseconds(value: number): DateTime
  • Parameters

    • value: number

    Returns DateTime

addMinutes

  • Parameters

    • value: number

    Returns DateTime

addMonths

  • Parameters

    • value: number

    Returns DateTime

addSeconds

  • Parameters

    • value: number

    Returns DateTime

addTicks

  • Parameters

    • value: number

    Returns DateTime

addYears

  • Parameters

    • value: number

    Returns DateTime

compareTo

  • Parameters

    Returns number

equals

  • Parameters

    Returns boolean

firstDayOfFirthQuarter

firstDayOfFourthQuarter

firstDayOfMonth

firstDayOfQuarter

firstDayOfSecondQuarter

firstDayOfThirdQuarter

firstDayOfWeek

firstDayOfYear

getHashCode

  • getHashCode(): number
  • Returns number

lastDateTimeOfDay

lastDayOfFirthQuarter

lastDayOfFourthQuarter

lastDayOfMonth

lastDayOfQuarter

lastDayOfSecondQuarter

lastDayOfThirdQuarter

lastDayOfWeek

lastDayOfYear

negate

subtract

toNetJsonString

  • toNetJsonString(): string
  • Returns string

toOADate

  • toOADate(): number
  • Returns number

toOADate2

  • toOADate2(round: boolean): number
  • Parameters

    • round: boolean

    Returns number

toShortDateString

  • toShortDateString(): string
  • Returns string

toShortTimeString

  • toShortTimeString(): string
  • Returns string

toString

  • toString(format?: string): string
  • By default date and time is converted into American format.

    Parameters

    • Default value format: string = "G"

    Returns string

Static compare

Static dateToNetTicks

  • dateToNetTicks(date: Date): number
  • Parameters

    • date: Date

    Returns number

Static daysInMonth

  • daysInMonth(year: number, month: number): number
  • The month number ranging from 1 to 12. JS calculate month from 0. This will even work for December.

    Parameters

    • year: number
    • month: number

    Returns number

Static fromNetJsonString

  • fromNetJsonString(jsonDate: string): DateTime
  • Parameters

    • jsonDate: string

    Returns DateTime

Static fromOADate

  • Parameters

    • oadate: number

    Returns DateTime

Static fromString

  • fromString(d?: string, logError?: boolean): DateTime
  • Parameters

    • Default value d: string = "2015-12-31"
    • Default value logError: boolean = true

    Returns DateTime

Static fromString2

  • fromString2(format?: string, value: string, logError?: boolean): DateTime
  • Parameters

    • Default value format: string = "2015-12-31"
    • value: string
    • Default value logError: boolean = true

    Returns DateTime

Static getNetTypeName

  • getNetTypeName(): string
  • Returns string

Static isISO8601String

  • isISO8601String(d: string): boolean
  • Parameters

    • d: string

    Returns boolean

Static isLeapYear

  • isLeapYear(year: number): boolean
  • Parameters

    • year: number

    Returns boolean

Static oaDateToTicks0

  • oaDateToTicks0(oaDate: number): number
  • Parameters

    • oaDate: number

    Returns number

Static parse

  • Parameters

    • value: string

    Returns DateTime

Static ticksNetToTicksJs

  • ticksNetToTicksJs(ticks: number): number
  • Parameters

    • ticks: number

    Returns number

Static ticksToOADate0

  • ticksToOADate0(ticks: number): number
  • Parameters

    • ticks: number

    Returns number

Static tryParse

  • tryParse(d?: string): object
  • Parameters

    • Default value d: string = "2015-12-31"

    Returns object

    • result: DateTime
    • successfully: boolean

Static tryParseExact

  • tryParseExact(d?: string, format: string[]): object
  • Parameters

    • Default value d: string = "2015-12-31"
    • format: string[]

    Returns object

    • result: DateTime
    • successfully: boolean

Generated using TypeDoc