Search
 
SCRIPT & CODE EXAMPLE
 

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

PREVIOUS NEXT
Code Example
Javascript :: set dropdown in jquery 
Javascript :: React site warning: The href attribute requires a valid address. Provide a valid, navigable address as the href value jsx-a11y/anchor-is-valid 
Javascript :: js capitalize 
Javascript :: using .includes for an array of objects js 
Javascript :: antd modal hide ok button 
Javascript :: Write the JavaScript code to set the width of element to 50%; 
Javascript :: outer width jquery 
Javascript :: javascript copy some properties from one object to another 
Javascript :: change alt text javascript 
Javascript :: expo react native 
Javascript :: how to get specific word from the string javascript 
Javascript :: jquery duplicate last table row 
Javascript :: javascript read file lines into array vanilla 
Javascript :: click on a radio button using jquery 
Javascript :: get last index of array 
Javascript :: setting className using useEffect 
Javascript :: javascript object filter 
Javascript :: arabic regex javascript 
Javascript :: how to add numbers in an array in javascript 
Javascript :: select default value react 
Javascript :: vowel 
Javascript :: react native open gmail app 
Javascript :: reactbootstrap multiselect 
Javascript :: convert utc string to date format of mm dd/mm/yyyy in javascript 
Javascript :: regex for email validation 
Javascript :: js remove li from ul 
Javascript :: js random string from array 
Javascript :: queryselector name attribute 
Javascript :: jquery in array 
Javascript :: java gson string to json 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =