Iam having an issue with tryin figure out hours between 2 times.
i have
$start = "8:00PM"; $end = "1:00AM"; // tried using strtotime $diff = strtotime($start) - strtotime($end); echo date("h", $diff); // gives me but should be 5.
anyone have a clue?
Without a date portion for the time string, strtotime() is going to assume that both times are from "today"; so you'll be subtracting 1:00AM today from 8:00PM today.
I put
$start = "2009-03-28 8:00PM"; $end = "2009-03-29 1:00AM"; $diff = strtotime($start) - strtotime($end); echo date("h", $diff);
but i still get the same result?
figured it out, found a function online.