my date format is like : Wednesday, 22 Apr, 2015, 12:39 PM
How i separate date and time like Below ?
> Date :- April 22 2015
> Time :- 12:39 PM
First remove the commas and use strtotime
:
$dt = 'Wednesday, 22 Apr 2015, 12:39 PM';
$dt = strtotime(str_replace(',', '', $dt));
$d = date('F d Y',$dt);
$t = date('h:i A',$dt);
echo $d,'<br/>',$t;
Output:
April 22 2015
12:39 PM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With