PHP DateTime::createFromFormat AM PM Issue

后端 未结 1 993
隐瞒了意图╮
隐瞒了意图╮ 2021-01-15 20:43
$format = \'d M Y A h:i\';
$date = DateTime::createFromFormat($format, \'11 Mar 2013 PM 3:34\');

Returns false. getLastErrors returs:

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-15 21:48

    I would append the AM/PM after the time. See http://php.net/manual/en/datetime.formats.time.php for accepted time formats.

    0 讨论(0)
提交回复
热议问题