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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |