phpretard Posted July 26, 2009 Share Posted July 26, 2009 I need to print out the time but I cant figure??? $calls['stamp']="2009-07-26 12:02:53"; $startdate=$calls['stamp']; $predate=explode(' ', $startdate); $splitdate=explode('-', $predate[0]); $Date="$splitdate[1]-$splitdate[2]-$splitdate[0]"; This prints out "07-26-2009"; I need the time as well. Any help? Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 $calls['stamp']="2009-07-26 12:02:53"; $startdate=$calls['stamp']; $predate=explode(' ', $startdate); $splitdate=explode('-', $predate[0]); $splittime=explode(':', $predate[1]); $Date="$splitdate[1]-$splitdate[2]-$splitdate[0]"; $time=$splittime[0].":".$splittime[1].":".$splittime[2]; Quote Link to comment Share on other sites More sharing options...
zq29 Posted July 26, 2009 Share Posted July 26, 2009 echo $predate[1]; Quote Link to comment Share on other sites More sharing options...
vineld Posted July 26, 2009 Share Posted July 26, 2009 Why not simply use date() instead? Quote Link to comment Share on other sites More sharing options...
phpretard Posted July 26, 2009 Author Share Posted July 26, 2009 Thanks!!! Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 26, 2009 Share Posted July 26, 2009 Assuming you don't need to reuse all those variables: $calls['stamp']="2009-07-26 12:02:53";; echo date('n-j-Y g:i:s', strtotime($calls['stamp'])); // Output:7-26-2009 12:02:53 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.