Temporal.ZonedDateTime.prototype.year

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 year của các thực thể Temporal.ZonedDateTime trả về một số nguyên biểu thị số năm của ngày này so với năm epoch đặc thù theo lịch. Thuộc tính này phụ thuộc vào lịch.

Set accessor của yearundefined. 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, hãy xem Temporal.PlainDate.prototype.year.