Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The month
accessor property of Temporal.PlainDate
instances returns a positive integer representing the 1-based month index in the year of this date. The first month of this year is 1
, and the last month is the monthsInYear
. It is calendar-dependent.
Note that unlike Date.prototype.getMonth()
, the index is 1-based. If the calendar has leap months, then the month with the same monthCode
may have different month
indexes for different years.
Note: Do not use this property to identify the actual month, including its name. Use monthCode
for that purpose. Use month
only for identifying months within the context of a year, or to figure out their order.
The set accessor of month
is undefined
. You cannot change this property directly. Use the with()
method to create a new Temporal.PlainDate
object with the desired new value.