【发布时间】:2015-01-01 11:25:37
【问题描述】:
如何将此 2014-11-03 17:01:37 转换为 Unix 时间戳? 有没有可以用的方法。
【问题讨论】:
标签: php date unix-timestamp type-conversion
如何将此 2014-11-03 17:01:37 转换为 Unix 时间戳? 有没有可以用的方法。
【问题讨论】:
标签: php date unix-timestamp type-conversion
为此,PHP 有一个function strtotime。
echo strtotime("2014-11-03 17:01:37");
【讨论】:
您可以创建一个DateTime 对象:
$time = new DateTime("2014-11-03 17:01:37");
$time->getTimestamp();
【讨论】:
strtotime('2014-11-03 17:01:37')
【讨论】:
使用 - strtotime()
$date = "2014-11-03 17:01:37";
echo strtotime($date);
【讨论】: