EvaldoMaciel

Retorna Data Brasil

Jul 8th, 2021
842
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getData() {
  2.     var data = new Date();
  3.     var dia = data.getDate();
  4.     var mes = data.getMonth() + 1;
  5.     var ano = data.getFullYear();
  6.     dia = (dia <= 9 ? "0" + dia : dia);
  7.     mes = (mes <= 9 ? "0" + mes : mes);
  8.     var novaData = dia + "/" + mes + "/" + ano;
  9.     return novaData;
  10. }
RAW Paste Data