我这种格式外汇牌价12小时至24小时12:00:上午 - > 00:00:00
// $start equals 2014-04-19 12:00:am
// I need to convert to 24hr 2014-04-19 00:00:00
$startconvert = str_replace(':am', '', $start);
$startconverted = date('Y-d-m H:i:s', strtotime($startconvert));
echo($startconverted);
//becomes 2014-19-04 12:00:00 which is 12pm
任何人都知道如何做到这一点得到一个日期时间格式从一种形式?这看起来我的权利,但它最终被12点
你真的在'am'之前有':'吗? –
我正要问同样的问题。这可能是你唯一的问题。不要更换'am',只需用空格替换最后的':'。 – James