diff --git a/src/stdlib/date.md b/src/stdlib/date.md index 23ec0a326..be995a693 100644 --- a/src/stdlib/date.md +++ b/src/stdlib/date.md @@ -6,7 +6,7 @@ description: Represents timestamps. Represents timestamps. -The Date API is still preliminary and requires importing the `Date` object from the host \(as `Date`\). +The Date API is still preliminary with only a subset of properties and methods implemented. Note that getting the current date, via `Date.now`, requires importing the `Date` object from the host \(as `Date`\). ## Constructor @@ -20,7 +20,7 @@ The Date API is still preliminary and requires importing the `Date` object from * ```ts function now(): i64 ``` - Returns the current UTC timestamp in milliseconds. + Returns the current UTC timestamp in milliseconds. To use this function you must import the `Date` object from the host \(as `Date`\). * ```ts function UTC( @@ -34,6 +34,11 @@ The Date API is still preliminary and requires importing the `Date` object from ): i64 ``` Returns the UTC timestamp in milliseconds of the specified date. + +* ```ts + function fromString(dateTimeString: string): Date + ``` + Creates a Date object from an ISO 8601 formatted string. ## Instance members @@ -46,3 +51,79 @@ The Date API is still preliminary and requires importing the `Date` object from function setTime(value: i64): i64 ``` Sets the UTC timestamp of this date in milliseconds and returns the timestamp. + +* ```ts + function getUTCFullYear(): i32 + ``` + Gets the full year according to universal time. + +* ```ts + function setUTCFullYear(value: i32): i32 + ``` + Sets the full year according to universal time. + +* ```ts + function getUTCMonth(): i32 + ``` + Gets the (zero indexed) month according to universal time. + +* ```ts + function setUTCMonth(value: i32): i32 + ``` + Sets the (zero indexed) month according to universal time. + +* ```ts + function getUTCDate(): i32 + ``` + Gets the day of the month according to universal time. + +* ```ts + function setUTCDate(value: i32): i32 + ``` + Sets the day of the month according to universal time. + +* ```ts + function getUTCHours(): i32 + ``` + Gets the hour according to universal time. + +* ```ts + function setUTCHours(value: i32): i32 + ``` + Sets the hour according to universal time. + +* ```ts + function getUTCMinutes(): i32 + ``` + Gets the minute according to universal time. + +* ```ts + function setUTCMinutes(value: i32): i32 + ``` + Sets the minute according to universal time. + +* ```ts + function getUTCSeconds(): i32 + ``` + Gets the second according to universal time. + +* ```ts + function setUTCSeconds(value: i32): i32 + ``` + Sets the second according to universal time. + +* ```ts + function getUTCMilliseconds(): i32 + ``` + Gets the millisecond according to universal time. + +* ```ts + function setUTCMilliseconds(value: i32): i32 + ``` + Sets the millisecond according to universal time. + +* ```ts + function toISOString(): string + ``` + Returns the a string in simplified extended ISO 8601 format. +