Temporal.ZonedDateTime.prototype.daysInYear
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 daysInYear của các thực thể Temporal.ZonedDateTime trả về một số nguyên dương biểu thị số ngày trong năm của ngày này. Giá trị này phụ thuộc vào lịch.
Set accessor của daysInYear là undefined. Bạn không thể thay đổi thuộc tính này trực tiếp.
Để biết thêm thông tin chung và các ví dụ khác, xem Temporal.PlainDate.prototype.daysInYear.
Ví dụ
>Sử dụng daysInYear
js
const dt = Temporal.ZonedDateTime.from("2021-07-01[America/New_York]");
console.log(dt.daysInYear); // 365
Thông số kỹ thuật
| Specification |
|---|
| Temporal> # sec-get-temporal.zoneddatetime.prototype.daysinyear> |
Tính tương thích với trình duyệt
Xem thêm
Temporal.ZonedDateTimeTemporal.ZonedDateTime.prototype.with()Temporal.ZonedDateTime.prototype.add()Temporal.ZonedDateTime.prototype.subtract()Temporal.ZonedDateTime.prototype.yearTemporal.ZonedDateTime.prototype.dayOfYearTemporal.ZonedDateTime.prototype.daysInMonthTemporal.ZonedDateTime.prototype.daysInWeekTemporal.PlainDate.prototype.daysInYear