Javascript format date time

var today = new Date();
var dd = today.getDate();

var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
var hh = today.getHours();
var ii = today.getMinutes();
var ss = today.getSeconds();

if(dd<10)
{
    dd='0'+dd;
}

if(mm<10)
{
    mm='0'+mm;
}
today = yyyy+'-'+mm+'-'+dd+' '+hh+':'+ii+':'+ss;

console.log(today);
today = mm+'/'+dd+'/'+yyyy;
console.log(today);
today = dd+'-'+mm+'-'+yyyy;
console.log(today);
today = dd+'/'+mm+'/'+yyyy;
console.log(today);

source: https://www.w3resource.com/javascript-exercises/javascript-basic-exercise-3.php

Checking Root Account Status

  Checking Local Root Account Status Run sudo passwd -S root : Look for the status letter in the output. An L means the account is locked (...

Mais vistos