I need to get the day of the month from a Date object but it seems that the getDay()
method returns the day of the week. Is there a function that returns the day of the month?
标签:
javascript
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Use
date_object
.getDate()
to get the month day.From the MDN docs link:
Try getDate() instead. Confusing naming, but that's life...
is the method you want to call on a date object. As show in the documentation:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date