Answers for "new date javascript with year"

8

how to get the year in javascript

new Date().getFullYear(); // This will get you the current year
Posted by: Guest on April-21-2020
2

js get day month year

const d = new Date();

d.getMonth() + 1;	// Month	[mm]	(1 - 12)
d.getDate();		// Day		[dd]	(1 - 31)
d.getFullYear();	// Year		[yyyy]
Posted by: Guest on July-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language