Temporal.PlainDateTime.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 accessor nanosecond của các instance Temporal.PlainDateTime trả về một số nguyên từ 0 đến 999 đại diện cho thành phần nano giây (10-9 giây) của thời gian 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. Sử dụng phương thức with() để tạo một đối tượng Temporal.PlainDateTime mới với giá trị mới mong muốn.
Để biết thông tin chung và thêm ví dụ, xem Temporal.PlainTime.prototype.nanosecond.
Ví dụ
>Sử dụng nanosecond
js
const dt = Temporal.PlainDateTime.from("2021-07-01T12:34:56.123456789");
console.log(dt.nanosecond); // 789
Đặc tả
| Specification |
|---|
| Temporal> # sec-get-temporal.plaindatetime.prototype.nanosecond> |
Tương thích trình duyệt
Xem thêm
Temporal.PlainDateTimeTemporal.PlainDateTime.prototype.with()Temporal.PlainDateTime.prototype.add()Temporal.PlainDateTime.prototype.subtract()Temporal.PlainDateTime.prototype.secondTemporal.PlainDateTime.prototype.millisecondTemporal.PlainDateTime.prototype.microsecondTemporal.PlainTime.prototype.nanosecond