I’m currently working on a website where customers are able to cancel an order, but they can only cancel it up to 4pm 1 day before the end of the order.
I know how to get the previous day, but I can’t figure out how to find out if it’s 4pm or not.
$prevDay = date("Y-m-d h:m:s", strtotime('-1 day', strtotime($order->date."00:00:00")));
This gives me this output: 2011-05-08 12:05:00
EDIT: Wait, not sure if the logic is right there, but in principle the $prevDay value should give you the date of 4PM yesterday.