Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
How to get TOTAL DAYS from two dates (one in sql database and then todays date (system date))

Need to show total days in html table.

I have the first date in myhpadmin table [CREATED_AT] and then todays date (not in database). Only what to show the total days in my html table, when I open the webpage.

Did get the script code from searching , but it does not show the info at all.

Not sure how to use print in the script

<td>
<?php $date = $checkSqlRow["DAYS_OLD"]; ?></td>
    <script>
            $date1 = $date = $checkSqlRow["CREATED_AT"];
            $date2 = today;
            $diff = abs(strtotime($date2) - strtotime($date1));
            $years = floor($diff / (365*60*60*24));
            $months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
            $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));


            printf("%d days\n", $days);             
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

With help from someone, it is working! within the td

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda