Tuesday 15 January 2013

Convert string to datetime PHP


You can convert this by using the function strtotime(). Here is the method.

<?PHP
 
$time = strtotime('10/16/2003 18:16'); 
 
$newformat = date('Y-m-d G:i:s',$time); 
 
echo $newformat; 
 
?>

Hope this helps !

No comments:

Post a Comment