Changing the datetime format in php -


here format

'd-m-y h:i:s'(15-11-2008  7:16:09) 

i want change format

'y-m-d h:i:s' (2008-11-15 07:16:09) 

tried strtotime() function, takes 'm' 'd' , 'd' 'm' help! new php..

current code`

$dt = strtotime($this->input->post('insert_dts')); $formated_date_time = date("y-m-d h:i:s",$dt);` 

as per code :

$dt = strtotime('15-11-2008 7:16:09'); echo $formated_date_time = date("y-m-d h:i:s",$dt); 

output :

2008-11-15 07:16:09


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -