Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

return current date in javascript

let today = new Date().toLocaleDateString()

console.log(today)
Comment

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
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript get hostname from current url 
Javascript :: javascript set div height 
Javascript :: how to get window size in react js 
Javascript :: document load complete jquery 
Javascript :: build json object in java 
Javascript :: file input disable open file picker javascript 
Javascript :: javascript array foreach example 
Javascript :: mongoose string index 
Javascript :: js create script tag request 
Javascript :: angular schematics datatable 
Javascript :: codewars js Beginner Series #1 School Paperwork 
Javascript :: get all iinputs of type button 
Javascript :: jquery array merge 
Javascript :: htaccess to deploy react app to cpanel 
Javascript :: javascript convert string to float with 2 decimal places 
Javascript :: js add click listener 
Javascript :: react how to scroll to element 
Javascript :: convert string array to objectid mongoose 
Javascript :: breaking from a labeled while loop js 
Javascript :: moment between exclusivity 
Javascript :: cursor to pointer in react 
Javascript :: add last element in array javascript 
Javascript :: js revers string fucntion 
Javascript :: server error payload too large base64 image 
Javascript :: expo android built is huge 
Javascript :: js nullish 
Javascript :: ClassNotFoundException: com.fasterxml.jackson.core.JsonGenerator 
Javascript :: set html attribute jquery 
Javascript :: create array initialize size javascript 
Javascript :: how to change country code to country name in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =