PHP: Problem with strtotime

前端 未结 4 1546
长发绾君心
长发绾君心 2020-12-21 19:02

What\'s going on with strtotime here?

$today = date(\'m.d.y H:i\', time());
echo strtotime($today);

It does not output anything... What\'s

4条回答
  •  臣服心动
    2020-12-21 19:16

    strtotime can only parse certain formats, not any random assortment of numbers and letters. "m.d.y H:i" is not a format strtotime can parse. You'll need to parse that manually using, for example, strptime.

提交回复
热议问题