immunity Posted June 25, 2007 Share Posted June 25, 2007 Hello i have a html that send times to php page (21:00) to make it valid time() i add string:00 right? so $string = 21:00; $string = $string.":00"; now how i make this string time ? how i add in that time 140 mins ? Link to comment https://forums.phpfreaks.com/topic/57097-solved-how-i-make-add-in-time-210000-140-minutes/ Share on other sites More sharing options...
per1os Posted June 25, 2007 Share Posted June 25, 2007 www.php.net/strtotime I believe thats what you want, and I do not think yo have to add the :00 to make "valid" Link to comment https://forums.phpfreaks.com/topic/57097-solved-how-i-make-add-in-time-210000-140-minutes/#findComment-282122 Share on other sites More sharing options...
immunity Posted June 25, 2007 Author Share Posted June 25, 2007 hm yes i dont need but i need to remove last :00 to put it inside my drop list thx! Link to comment https://forums.phpfreaks.com/topic/57097-solved-how-i-make-add-in-time-210000-140-minutes/#findComment-282126 Share on other sites More sharing options...
Caesar Posted June 25, 2007 Share Posted June 25, 2007 <?php $str = strtotime('21:00:00'); //To convert it to a timestamp that will include today's date $newstr = date("H:i", $str); //Will equal "21:00" //$newstr = date("M d, Y - H:i", $str); //Will equal "Jun 25, 2007 - 21:00" echo $newstr; ?> Link to comment https://forums.phpfreaks.com/topic/57097-solved-how-i-make-add-in-time-210000-140-minutes/#findComment-282128 Share on other sites More sharing options...
immunity Posted June 25, 2007 Author Share Posted June 25, 2007 thx ! Link to comment https://forums.phpfreaks.com/topic/57097-solved-how-i-make-add-in-time-210000-140-minutes/#findComment-282408 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.