Results 1 to 4 of 4
Jun 25, 2007, 14:23 #1
- Join Date
- Dec 2004
- 0 Post(s)
- 0 Thread(s)
need to find pro-rated price ($today - 2007-12-31) / (number of days in year)
I am trying to get a pro-rated subscription price based on when they sign up.
I order to get the number of days between today and the end of the year, I first have to know I need to get the number of days in THIS year - since there are leap years.
I think this code will work for getting the #days between now and end of year:
$year_end = Year(date())."-12-31";
$date_diff = round( abs(strtotime(date('y-m-d'))-strtotime($year_end)) / 86400, 0 );
Any ideas besides calling the easy MySQL DATEDIFF() function?
($date_diff/(total number of days this year)) * pricing