setFullYear()
x is four digit year.
Let us try one example.
Output is here
Setting the year part from present yearWe can set the year part by reading the present year using getYear function and then use set year part to set the year to a different value. Here is one example
Output is here
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
|
▼ More on JavaScript Date |