Wednesday, July 8, 2020

new Date(); manupulation in JS





let today = new Date();
let dd = String(today.getDate()).padStart(2, '0');
let mm = String(today.getMonth() + 1).padStart(2, '0');
let yyyy = today.getFullYear();
let hh = today.getHours();
let min = today.getMinutes();
let ss = today.getSeconds();
var milis = today.getMilliseconds();


let dateTime = yyyy + "-" + mm + "-" + dd + "_" + hh + "-" + min + "-" + ss+"-"+milis;

No comments:

Post a Comment

Autoboxing and Unboxing

  Autoboxing  is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper cl...