javascript date html code example
Example 1: javascript date
var d= new Date();
d.getFullYear();
d.getMonth();
d.getDate();
d.getHours();
d.getMinutes();
d.getSeconds();
d.getMilliseconds();
d.getTime();
Example 2: javascript date
var currentDate = new Date();
var dateFromTimeStamp= new Date(1560807962);
var dateFromString = new Date('December 17, 1995 03:24:00');
var dateFromYearMonthDay = new Date(2018, 11, 26, 0, 0, 0, 0);
Example 3: html date
<label for="meeting">Next meeting (August 2021):</label>
<input type="date"
id="meeting"
name="meeting"
min="2021-08-01"
max="2021-08-31"
defaultValue="2021-08-01">
Example 4: calculate today date javascript
var today = new Date();