Date & Time
To add a date -
- let date = new Date();
- console.log(date);
This is a constructor and a date is an article.
The worth inside the date object gives the time after that specific millisecond from where the reference is taken.
Notwithstanding, there is one more approach to instate the date -
- new Date(year, month, date, hours, minutes, seconds, milliseconds);
Through this constructor, we can instate the information in the given configuration. Some more capacities assist us with knowing the year, month, date, and time straightforwardly -
- GetFullYear() - To get Year.
- GetDate() - To get Date.
- GetMonth() - To get Month.
- GetHours() - To get Hours.
We can likewise set date and time physically with the capacities like setDate() and few moments
If we compose the worth inside the setDate() work more than 31, the JavaScript naturally regards it as another date and gives it another worth beginning from 1
0 Comments