Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

today date js

let today = new Date().toLocaleDateString();

//or function
function getDate()
{
	let  today 		= new Date();
	let  dd 		= String(today.getDate()).padStart(2, '0');
	let  mm 		= String(today.getMonth() + 1).padStart(2, '0'); //janvier = 0
	let  yyyy 		= today.getFullYear();
  
	return `${yyyy}-${mm}-${dd}`; 
	//return dd + '/' + mm + '/' + yyyy; // change form if you need
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #today #date #js
ADD COMMENT
Topic
Name
6+2 =