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

170
Views
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 answers
Answer question

0

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

about 4 years ago · Santiago Gelvez 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!