Temporal.ZonedDateTime.prototype.daysInMonth
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 daysInMonth của các instance Temporal.ZonedDateTime trả về một số nguyên dương biểu diễn số ngày trong tháng của ngày này. Giá trị này phụ thuộc vào calendar.
Set accessor của daysInMonth 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à ví dụ, hãy xem Temporal.PlainDate.prototype.daysInMonth.
Ví dụ
>Sử dụng daysInMonth
js
const dt = Temporal.ZonedDateTime.from("2021-07-01[America/New_York]");
console.log(dt.daysInMonth); // 31
Đặc tả kỹ thuật
| Specification |
|---|
| Temporal> # sec-get-temporal.zoneddatetime.prototype.daysinmonth> |
Khả năng 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.monthTemporal.ZonedDateTime.prototype.dayTemporal.ZonedDateTime.prototype.daysInWeekTemporal.ZonedDateTime.prototype.daysInYearTemporal.PlainDate.prototype.daysInMonth