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

165
Views
reste el tiempo antiguo de mysql a partir del tiempo actual usando la nueva función de fecha del script java

Importé el tiempo de MySQL y quiero restarlo de ahora usando el script Java, el código que he usado a continuación, pero el resultado que obtuve es "Fecha no válida". Puedes ver mi horario a continuación.

 setInterval(function(){ $(document).ready(function () { $.ajax({ url: "plate.php", method:"GET", dataType:"JSON", success: function (data) { var id = []; var Time = []; var tp5 = []; for (var i in data){ var oldtime = ((data[i].Time)); console.log(data[i].id); console.log(data[i].tp5); var nowtime= new Date(); console.log(today); var newDateObj = new Date(nowtime- oldtime); document.getElementById("datetime").innerHTML = newDateObj; } } }); }); }, 6000);

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

oldtime debe ser un objeto JS Date.

Cambio:

 var oldtime = ((data[i].Time));

A:

 // date and time parts let odp = data[i].Date.split("-"); let otp = data[i].Time.split(":"); let oldDate = new Date(odp[0], odp[1], odp[2], otp[0], otp[1], otp[2]);

Entonces puedes obtener la diferencia entre ellos con getTime

about 4 years ago · Juan Pablo Isaza 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!