I am developing my first PHP application and would like some help writing a function to find the number of days between a date stored in a mySQL database and the current date.
If anyone could help me with this, I would appreciate it.
I have a FAQ in this forum for calculating the difference between two dates in years, months, and days: faq434-3493
Also, you could use PHP's time() function to get the seconds timetick number for the current time, use PHP's strtotime() function to convert the MySQL-provided date to a seconds timetick number, subtract the smaller of the two from the larger, and divide that result by 86400 (24 hours/day * 60 minutes/hour * 60 seconds/minute) rounding down.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.