首页

strtotime PHP 手册

将任何字符串的日期时间描述解析为 Unix 时间戳

参数

time
日期/时间字符串。正确格式的说明详见 日期与时间格式。
now
用来计算返回值的时间戳。

返回值

成功则返回时间戳,否则返回 FALSE。在 PHP 5.1.0 之前本函数在失败时返回 -1。

在线运行

<?php
strtotime(''[, ] );

运行结果:

{{result.result}}
等于: {{result.format}}

参见

  • date - 格式化本地时间/日期