Home >Web Front-end >JS Tutorial >JavaScript Date object date acquisition function_time and date

JavaScript Date object date acquisition function_time and date

WBOY
WBOYOriginal
2016-05-16 18:13:451070browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn