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. Quote Link to comment 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. Quote Link to comment 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)); ?> Quote Link to comment Share on other sites More sharing options...
jackpf Posted April 28, 2009 Share Posted April 28, 2009 Meh. 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.