Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
formato de fecha jQuery

¿Cómo puedo formatear la fecha usando jQuery? Estoy usando el siguiente código pero obtengo un error:

 $("#txtDate").val($.format.date(new Date(), 'dd M yy'));

Sugiera una solución.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

agregue el complemento jquery ui en su página.

 $("#txtDate").val($.datepicker.formatDate('dd M yy', new Date()));
over 4 years ago · Santiago Trujillo Report

0

jQuery dateFormat es un complemento separado. Debe cargar eso explícitamente usando una etiqueta <script> .

over 4 years ago · Santiago Trujillo Report

0

Una alternativa sería la función js date() simple, si no desea utilizar el complemento jQuery/jQuery:

p.ej:

 var formattedDate = new Date("yourUnformattedOriginalDate"); var d = formattedDate.getDate(); var m = formattedDate.getMonth(); m += 1; // JavaScript months are 0-11 var y = formattedDate.getFullYear(); $("#txtDate").val(d + "." + m + "." + y);

ver: 10 formas de formatear la hora y la fecha usando JavaScript

Si desea agregar ceros iniciales al día/mes, este es un ejemplo perfecto: Javascript agrega ceros iniciales a la fecha

y si desea agregar tiempo con ceros a la izquierda, intente esto: getMinutes () 0-9: ¿cómo con dos números?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!