input type date format dd-mm-yyyy code example

Example 1: how to set a date for type date inpt

<input type="date" id="start" name="trip-start" value="2018-07-22">

Example 2: format dd mm yyyy for input date

<!DOCTYPE html> 
<html> 

<head> 
	<title> 
		How to get input type date 
		in dd-mm-yyyy format ? 
	</title> 
	
	<style> 
		body { 
			text-align: center; 
		} 
		h1 { 
			color: green; 
		} 
	</style> 
</head> 

<body> 
	<h1>Student Tutorial</h1> 
	
	<h3> 
		Get input date in 
		dd-mm-yyyy format 
	</h3> 
	
	<label for="start"> 
		Enter the Date: 
	</label> 

	<input type="date" name="begin"
		placeholder="dd-mm-yyyy" value=""
		min="1997-01-01" max="2030-12-31"> 
</body> 

</html>

Example 3: python datetime format yyyy-mm-dd

from datetime import datetime
now = datetime.today().isoformat()
print(now) # '2018-12-05T11:15:55.126382'