Home >Web Front-end >JS Tutorial >JavaScript Date object date acquisition function_time and date
A small example of using JavaScript Date object:
Run result:
Summary:
1. Although we think December is the 12th month, JavaScript starts counting months from 0, so month 11 means December;
2. nowDate.setDate(33); JavaScript knows that there are no 33 days in December, only 31 days, so it returns January 2 to us;
Attachment: List of Date methods