Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
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 Respostas
Responde à pergunta

0

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

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda