【发布时间】:2015-07-30 19:12:41
【问题描述】:
如何获取“5 月 19 日星期二 1:24 pm”的小时和分钟?谢谢
我的测试:
<?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
【问题讨论】:
-
用 pm 或 am 分割并在末尾追加。并将它传递给 strtotime 然后它会工作