×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: user7784c
Added: Jun 14, 2017 6:08 PM
Views: 5
  1.    // Dar formato fecha Javascript
  2.    function DiaActual()
  3.    {
  4.       var F = new Date();
  5.       var Y = F.getFullYear();
  6.       var M = F.getMonth() + 1;
  7.       var D = F.getDate();
  8.      
  9.       var H = F.getHours();
  10.       var Mi = F.getMinutes();
  11.      
  12.       if(M <= 9){M = '0' + M;}
  13.       if(D <= 9){D = '0' + D;}
  14.      
  15.       var FC = Y + "-" + M + "-" + D + " " + H + ":" + Mi;
  16.      
  17.       return FC;
  18.    }
  19.