-
-
Notifications
You must be signed in to change notification settings - Fork 688
Expand file tree
/
Copy pathdate.ts
More file actions
38 lines (31 loc) · 622 Bytes
/
date.ts
File metadata and controls
38 lines (31 loc) · 622 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import {
UTC as Date_UTC,
now as Date_now
} from "./bindings/Date";
export class Date {
@inline static UTC(
year: i32,
month: i32 = 0,
day: i32 = 1,
hour: i32 = 0,
minute: i32 = 0,
second: i32 = 0,
millisecond: i64 = 0
): i64 {
return <i64>Date_UTC(year, month, day, hour, minute, second, <f64>millisecond);
}
@inline static now(): i64 {
return <i64>Date_now();
}
private value: i64;
constructor(value: i64) {
this.value = value;
}
getTime(): i64 {
return this.value;
}
setTime(value: i64): i64 {
this.value = value;
return value;
}
}