jkkenzie Posted September 6, 2011 Share Posted September 6, 2011 $startdt = $_POST['startdt'].":".$_POST['starttmh'].":".$_POST['starttmm'].":".$_POST['sAMPM']; // 09/08/2011:11:35:AM $enddt = $_POST['enddt'].":".$_POST['endtmh'].":".$_POST['endtmm'].":".$_POST['eAMPM']; //09/09/2011:11:35:AM From the code above I want to subtract 09/08/2011:11:35:AM from 09/09/2011:11:35:AM and get the total number of hours. A simple solution would be highly appreciated: thanks in advance: Quote Link to comment Share on other sites More sharing options...
WebStyles Posted September 6, 2011 Share Posted September 6, 2011 You can convert both to seconds with strtotime then substract one from the other... Quote Link to comment Share on other sites More sharing options...
jkkenzie Posted September 7, 2011 Author Share Posted September 7, 2011 ok Thanks . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.