Jump to content


This topic is now archived and is closed to further replies.


date calculations

Recommended Posts

quick question about dates calculation, I have it setup where when someone
I have paypal integration complete it records the date of the transaction depending on how much they paid it records either 30 or 365 days just as a number 30 or 365 I need to take the date, I have the date organized where it records m/d/y or mm/dd/yyyy actually and the timeperiod set to whichever is necessary I am pulling all this from the database for every login and trying to check the date, I ahve recorded, and the current date, and see how many days has passed and update accordingly
but if all the days has passed them I am going to remove some fields, and reset that back to paid = no
I don't want to know how to do anything I just wnated to know what is a good basis to start, being able to take 1 date and take another date and check to see how many days between those dates have passwed passed

Share this post

Link to post
Share on other sites
This has been answered many times in this forum...
$date1 = strtotime('7/25/2006'); // number of seconds since 1-1-1970
$date2 = strtotime('1/1/2006');
$number_days = floor(($date1 - $date2)/86400); // 86400 = the number of seconds in a day
echo $number_days;


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.