本周一的时间戳
strtotime(
'this week Monday'
,time());
注意:下面两个在不是周一的情况下获取正确,是周一获取的是上个周一;
-
strtotime( "previous monday" );
-
strtotime( ' monday -6 day' ,time())// 当前时间的周一时间戳
strtotime('monday');
//下周一时间戳
其他常用的:
-
strtotime('today'); //今天
-
strtotime('next monday'); //下个周一
-
strtotime('last Friday'); //上个周五
-
strtotime("next Friday", strtotime("2017-05-13")); //固定日期的下一个星期五 ps: 是下一个星期五,并不是下一个星期的星期五 比如今天是星期三,next friday 是本周的周五 并不是下个星期的周五
-
strtotime('last week friday' );// 上个星期的星期五
以下是年,月,周,天,时,分秒的用法
date("Y-m-d H:i:s", strtotime(" +2 year"));
date("Y-m-d H:i:s", strtotime(" +2 month"));
date("Y-m-d H:i:s", strtotime(" +2 week"));
date("Y-m-d H:i:s", strtotime(" +2 day"));
date("Y-m-d H:i:s", strtotime(" +2 hour"));
date("Y-m-d H:i:s", strtotime(" +2 minute"));
date("Y-m-d H:i:s", strtotime(" +2 second"));