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

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -