Answers for "javascript date parse from format dd/mm/yyyy hh mm ss"

13

mm dd yyyy how to get date in this format 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

javascript date from string dd/mm/yyyy HH mm ss

var d='dd/mm/yy hh:MM:ss';
    var d1=d.split(" ");
    var date=d1[0].split("/");
    var time=d1[1].split(":");
    var dd=date[0];
    var mm=date[1]-1;
    var yy=date[2];
    var hh=time[0];
    var min=time[1];
    var ss=time[2];
    var fromdt= new Date("20"+yy,mm-1,dd,hh,min,ss);
Posted by: Guest on June-02-2021

Code answers related to "javascript date parse from format dd/mm/yyyy hh mm ss"

Code answers related to "Javascript"

Browse Popular Code Answers by Language