Temporal.ZonedDateTime.prototype.nanosecond
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Thuộc tính truy cập nanosecond của các thực thể Temporal.ZonedDateTime trả về một số nguyên từ 0 đến 999 biểu thị thành phần nanosecond (10-9 giây) của thời điểm này.
Set accessor của nanosecond là undefined. Bạn không thể thay đổi thuộc tính này trực tiếp. Hãy sử dụng phương thức with() để tạo một đối tượng Temporal.ZonedDateTime mới với giá trị mong muốn.
Để biết thêm thông tin chung và các ví dụ khác, xem Temporal.PlainTime.prototype.nanosecond.
Ví dụ
>Sử dụng nanosecond
js
const dt = Temporal.ZonedDateTime.from(
"2021-07-01T12:34:56.123456789-04:00[America/New_York]",
);
console.log(dt.nanosecond); // 789
Đặc tả
| Specification |
|---|
| Temporal> # sec-get-temporal.zoneddatetime.prototype.nanosecond> |
Tương thích trình duyệt
Xem thêm
Temporal.ZonedDateTimeTemporal.ZonedDateTime.prototype.with()Temporal.ZonedDateTime.prototype.add()Temporal.ZonedDateTime.prototype.subtract()Temporal.ZonedDateTime.prototype.secondTemporal.ZonedDateTime.prototype.millisecondTemporal.ZonedDateTime.prototype.microsecondTemporal.PlainTime.prototype.nanosecond