strtotime 时间戳的用法

若成功则返回时间戳,失败则返回 FALSE。 php 4+

<?php echo(strtotime("now") . "<br>");//当前时间 2017/9/1 13:33:41 echo(strtotime("5 September 2016") . "<br>");//2016/9/5 0:0:0 echo(strtotime("+5 hours") . "<br>");//2017/9/1 18:33:41 当前时间加5小时 echo(strtotime("+1 week") . "<br>");//当前时间 + 1周 echo(strtotime("+1 week 3 days 7 hours 5 seconds") . "<br>"); //当前时间 + 1周 + 3天 + 7小时 + 5秒 echo(strtotime("next Monday") . "<br>");//当前时间的下周一 echo(strtotime("last Sunday"));//当前时间的上周日 ?>
posted @ 2017-09-01 13:39  玲汐  阅读(655)  评论(0编辑  收藏  举报