Constructors
constructor
- new DateTime(millisecondsSinceEpoch?: number): DateTime
-
Parameters
-
Optional
millisecondsSinceEpoch: number
Accessors
Day
- get Day(): number
-
Returns number
DayOfWeek
- get DayOfWeek(): DayOfWeek
-
Hours
- get Hours(): number
-
Returns number
Milliseconds
- get Milliseconds(): number
-
Returns number
Minutes
- get Minutes(): number
-
Returns number
Month
- get Month(): number
-
Returns number
Seconds
- get Seconds(): number
-
Returns number
WeekOfYear
- get WeekOfYear(): number
-
Returns number
Year
- get Year(): number
-
Returns number
Methods
Add
- Add(value: number): DateTime
-
- Add(value: number, unit: TimeUnit): DateTime
-
Clone
- Clone(): DateTime
-
Diff
- Diff(another: DateTime): number
-
Returns number
- Diff(another: DateTime, unit: TBaseTimeUnit): number
-
Returns number
Equals
- Equals(another: DateTime): boolean
-
Returns boolean
Subtract
- Subtract(value: number): DateTime
-
- Subtract(value: number, unit: TimeUnit): DateTime
-
ToDate
- ToDate(): Date
-
Returns Date
ToLocalString
- ToLocalString(): string
-
Returns string
- ToLocalString(format?: string): string
-
Returns string
ToString
- ToString(): string
-
Returns string
- ToString(format?: string, timezoneOffset?: number): string
-
Parameters
-
Optional
format: string
-
Optional
timezoneOffset: number
Returns string
Static
From
- From(date: Date): DateTime
-
- From(date: Date, timezoneOffset: number): DateTime
-
Parameters
-
date: Date
-
timezoneOffset: number
1 - 31