Answers for "js display now()"

3

js datetime now

var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
Posted by: Guest on February-22-2021
3

date now js

const t = new Date();
const date = ('0' + t.getDate()).slice(-2);
const month = ('0' + (t.getMonth() + 1)).slice(-2);
const year = t.getFullYear();

const time = `${date}/${month}/${year}`;

console.log(time);
Posted by: Guest on September-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language