PayPal will send the payment_date field in the following format 19:19:09 September 27, 2011
I use php to calculate the days left with payment_date, but my code is based on getting the format in 2011-09-27 12:19:00.
How do i change?
This is my code (which works fine if the date is in my correct format):
<?php $today = time(); $cdate = strtotime('2011-09-27');//strtotime($row_details['payment_date']);// testing $dateDiff = $today - $cdate; $fullDays = floor($dateDiff/(60*60*24)); $dayscalculate = 30 - $fullDays; // Set number of days echo $dayscalculate.(($dayscalculate == 1) ? " day" : " days"); ?>
thanks
source share