Answers for "javascript get date today yyyy-mm-dd"

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

reverse date javascript from yyyy/mm/dd to dd/mm/yyyy

function convertDigitIn(str){
   return str.split('/').reverse().join('/');
}
Posted by: Guest on July-05-2021
0

get yyyy-mm-dd hh:mm from date javascript

var d = new Date,
    dformat = [(d.getMonth()+1).padLeft(),
               d.getDate().padLeft(),
               d.getFullYear()].join('/') +' ' +
              [d.getHours().padLeft(),
               d.getMinutes().padLeft(),
               d.getSeconds().padLeft()].join(':');
//=> dformat => '05/17/2012 10:52:21'
Posted by: Guest on October-29-2021

Code answers related to "javascript get date today yyyy-mm-dd"

Code answers related to "Javascript"

Browse Popular Code Answers by Language