如何获取' tuesday 19 May下午1:24 '的小时和分钟?由于
我测试:<?php
$start_date = date("Y-m-d", strtotime($start_date_full));
$start_time = date("H:i a", strtotime($start_date_full));
echo $start_date . ', ' . $start_time;
输出:2015-05-19, 00:00
你可以这样做…
$d = '2015-05-19 13:24:00';
$f = date('g:i a D d M', strtotime($d));
echo $f;
// OUTPUT : 1:24 pm Tue 19 May
按此操作- http://php.net/manual/en/function.date.php
试试这个,我想这就是你想要的
$date = date("g:i a l d F");
输出:
5月19日星期二上午5:41
试试这个
$start_date_full = "1:24 pm Tue 19 May";
$format = "g:i a D j F";
$date_time = DateTime::createFromFormat($format, $start_date_full);
echo date_format($date_time,"g:i");