PHP:strtotime问题 [英] PHP: Problem with strtotime

查看:77
本文介绍了PHP:strtotime问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的strtotime是怎么回事?

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 going on?

推荐答案

strtotime只能解析某些格式,而不是数字和字母的任何随机组合. "m.d.y H:i"不是strtotime可以解析的格式.您需要使用例如 strptime 手动进行解析.

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.

这篇关于PHP:strtotime问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆