technophobe Posted May 31, 2013 Share Posted May 31, 2013 Hello, I am new to this site so please execuse my ignorance, I have piece of code that returns a time of 00:00:00 however I only want it to return 00:00. ie. 00:11:56 instead of 11:56. Can anyone help Thanks Time commenced: <select name="time_commenced" id="time_commenced"> <option value="<?php echo date('Hi'); ?>"><?php echo date('Hi'); ?></option> <?php $start = strtotime('0700');$end = strtotime('2000');?> <?phpfor ($i = $start; $i <= $end; $i += 360){?> <option value="<?php echo date('Hi', $i); ?>"><?php echo date('Hi', $i); ?></option> <?php}?> </select> Time completed: <select name="time_completed" id="time_completed"> <option value="<?php print date("Hi", mktime()+(6*60)); ?>"><?php print date("Hi", mktime()+(6*60));?></option> <?phpfor ($i = $start; $i <= $end; $i += 360){?> <option value="<?php echo date('Hi', $i); ?>"><?php echo date('Hi', $i); ?></option> <?php} Quote Link to comment https://forums.phpfreaks.com/topic/278622-php-time-format/ Share on other sites More sharing options...
Jessica Posted May 31, 2013 Share Posted May 31, 2013 Use code tags next time you post (the <> button) Read the manual page for date. It has everything you need to know about formatting a timestamp. The code you've posted won't produce the output you're describing however. So you may have other issues. Quote Link to comment https://forums.phpfreaks.com/topic/278622-php-time-format/#findComment-1433336 Share on other sites More sharing options...
technophobe Posted May 31, 2013 Author Share Posted May 31, 2013 Thanks, I added the : between Hi Quote Link to comment https://forums.phpfreaks.com/topic/278622-php-time-format/#findComment-1433338 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.