加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 获取当前时间的时间戳

发布时间:2020-12-13 18:22:30 所属栏目:PHP教程 来源:网络整理
导读:我有一个当天的日期时间.我需要获得两个unix时间戳的开始和本周的结束.我如何使用dateperiod或dateinterval类? $now = time();$beginning_of_week = strtotime('last Monday',$now); // Gives you the time at the BEGINNING of the week$end_of_week = str
我有一个当天的日期时间.我需要获得两个unix时间戳的开始和本周的结束.我如何使用dateperiod或dateinterval类?
$now = time();
$beginning_of_week = strtotime('last Monday',$now); // Gives you the time at the BEGINNING of the week
$end_of_week = strtotime('next Sunday',$now) + 86400; // Gives you the time at the END of the last day of the week

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读