(function($) { $("li.gf_readonly input").attr("readonly","readonly"); }); })(jQuery); format( 'm/d/Y H:i' ) ); $endtime = strtotime( $enddate->format( 'm/d/Y H:i' ) ); // check to see if the times span overnight if($starttime > $endtime) $endtime = strtotime($enddate->format('m/d/Y H:i:s') . " +1 day"); // perform calculation $diff = floor(($endtime - $starttime)/60/60); $_POST["input_16"] = $diff; }