Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Dieg Hard
Added: Jun 13, 2018 6:26 PM
Views: 10
Tags: no tags
Poner la fecha de hoy con jquery
  1.     //En el Load ponemos las fechas de ohoy
  2.     var now = new Date();
  3.     var day = ("0" + now.getDate()).slice(-2);
  4.     var month = ("0" + (now.getMonth() + 1)).slice(-2);
  5.     var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
  6.    
  7.     $("#mensaje").hide();
  8.    
  9.     $('#fecha').val(today);