Answers for "get today date w3school"

12

how to get today date in javascript

var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();

today = mm + '/' + dd + '/' + yyyy;
document.write(today);
Posted by: Guest on February-27-2020
0

html print today date

<input type='date' id='hasta' value='<?php echo date('Y-m-d');?>'>
Posted by: Guest on February-09-2021

Browse Popular Code Answers by Language