Ninjakreborn Posted July 27, 2006 Share Posted July 27, 2006 quick question about dates calculation, I have it setup where when someoneI 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 accordinglybut if all the days has passed them I am going to remove some fields, and reset that back to paid = noI 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 Quote Link to comment https://forums.phpfreaks.com/topic/15838-date-calculations/ Share on other sites More sharing options...
kenrbnsn Posted July 27, 2006 Share Posted July 27, 2006 This has been answered many times in this forum...[code]<?php$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 dayecho $number_days;?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/15838-date-calculations/#findComment-64857 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.