Temporal.ZonedDateTime.prototype.monthsInYear
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die monthsInYear Zugriffseigenschaft von Temporal.ZonedDateTime Instanzen gibt eine positive ganze Zahl zurück, die die Anzahl der Monate im Jahr dieses Datums darstellt. Sie ist kalenderabhängig (calendar).
Der Set-Accessor von monthsInYear ist undefined. Sie können diese Eigenschaft nicht direkt ändern.
Für allgemeine Informationen und weitere Beispiele, siehe Temporal.PlainDate.prototype.monthsInYear.
Beispiele
>Verwendung von monthsInYear
js
const dt = Temporal.ZonedDateTime.from("2021-07-01[America/New_York]");
console.log(dt.monthsInYear); // 12
Spezifikationen
| Specification |
|---|
| Temporal> # sec-get-temporal.zoneddatetime.prototype.monthsinyear> |
Browser-Kompatibilität
Siehe auch
Temporal.ZonedDateTimeTemporal.ZonedDateTime.prototype.with()Temporal.ZonedDateTime.prototype.add()Temporal.ZonedDateTime.prototype.subtract()Temporal.ZonedDateTime.prototype.yearTemporal.ZonedDateTime.prototype.monthTemporal.ZonedDateTime.prototype.monthCodeTemporal.ZonedDateTime.prototype.daysInMonthTemporal.PlainDate.prototype.monthsInYear