Answers for "change date and time format to yyyy/mm/dd javascript"

13

javascript date today dd mm yyyy

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

javascript format date object to yyyy-mm-dd

const yourDate = new Date()
yourDate.toISOString().split('T')[0]
Posted by: Guest on April-24-2021

Code answers related to "change date and time format to yyyy/mm/dd javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language