多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## strtotime (PHP 4, PHP 5, PHP 7) strtotime — 将任何字符串的日期时间描述解析为 Unix 时间戳 ### 说明 ~~~ int strtotime ( string $time [, int $now = time() ] ) ~~~ 本函数预期接受一个包含美国英语日期格式的字符串并尝试将其解析为 Unix 时间戳(自 January 1 1970 00:00:00 GMT 起的秒数),其值相对于 now 参数给出的时间,如果没有提供此参数则用系统当前时间。 本函数将使用 TZ 环境变量(如果有的话)来计算时间戳。自 PHP 5.1.0 起有更容易的方法来定义时区用于所有的日期/时间函数。此过程在 date_default_timezone_get() 函数页面中有说明。 ### 参数 #### time 日期/时间字符串。正确格式的说明详见 [日期与时间格式](http://php.net/manual/zh/datetime.formats.php)。 #### now 用来计算返回值的时间戳。 ### 范例 Example #1 strtotime() 例子 ~~~ <?php echo strtotime("now"), "\n"; echo strtotime("10 September 2000"), "\n"; echo strtotime("+1 day"), "\n"; echo strtotime("+1 week"), "\n"; echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n"; echo strtotime("next Thursday"), "\n"; echo strtotime("last Monday"), "\n"; ?> ~~~ * * * * * http://php.net/manual/zh/function.strtotime.php