I have to convert this string date 2016-09-26 00:00:00.000
to the yyyy-mm-dd
format without other characters.
Can you help me, please?
I have to convert this string date 2016-09-26 00:00:00.000
to the yyyy-mm-dd
format without other characters.
Can you help me, please?
Try this:
$datetime = '2016-09-26 00:00:00.000';
$date = date('Y-m-d', strtotime('2016-09-26 00:00:00.000'));
you will get the only date part in 'yyyy-mm-dd'
format.
$test = strtotime('2016-09-26 00:00:00.000');
$test1 = date('Y-m-d h:i', $test);
$array1 = explode(' ', $var);
$date_temp = $array1[0];