phpretard Posted April 28, 2009 Share Posted April 28, 2009 How can I print: 04-28-2009 when: $var="2009-04-28 07:50:09"; My brain is off today Thank you. Link to comment https://forums.phpfreaks.com/topic/155967-solved-dumb-question/ Share on other sites More sharing options...
jackpf Posted April 28, 2009 Share Posted April 28, 2009 $var="2009-04-28 07:50:09"; $var = explode('-', reset(explode(' ', $var))); echo $var[1].'-'.$var[2].'-'.$var[0]; Something like that anyway. Link to comment https://forums.phpfreaks.com/topic/155967-solved-dumb-question/#findComment-820988 Share on other sites More sharing options...
john-formby Posted April 28, 2009 Share Posted April 28, 2009 <?php $var = '2009-04-28 07:50:09'; echo date('m-d-Y', strtotime($var)); ?> Link to comment https://forums.phpfreaks.com/topic/155967-solved-dumb-question/#findComment-820991 Share on other sites More sharing options...
jackpf Posted April 28, 2009 Share Posted April 28, 2009 Meh. Link to comment https://forums.phpfreaks.com/topic/155967-solved-dumb-question/#findComment-821049 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.