//获取年月日对应的最近的周天的截止日期 可能会 跨年 跨月 跨周
function GetClearWeek() {
$year_month_day_over = array();
$year = date('Y'); //四位 的年份
$month = date('n'); //1 到 12
$day_of_month = date('j');//1-31 月份中的第几天
$day_of_week = date('N'); //1-7 周中的第几天
$day_of_year = date('z')+1; // 1-366 年的第几天
$days_of_month = date('t'); //当前月份 月份应有的天数
$day_should_over = $day_of_month - $day_of_week + 7;
if($day_should_over > $days_of_month) {
$month_over = $month + 1;
if($month_over > 12) {
$year_month_day_over = array(
'year_over' => $year + 1,'month_over' => 1,'day_over' => $day_should_over - $days_of_month,
);
} else {
$year_month_day_over = array(
'year_over' => $year ,'month_over' => $month + 1,'day_over' => $day_should_over - $days_of_month,
);
}
} else {
$year_month_day_over = array(
'year_over' => $year ,'month_over' => $month,'day_over' => $day_should_over,
);
}
return $year_month_day_over;
}
热门文章更多>>
标签更多>>
专题更多>>
最新文章更多>>
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源
- 使用 C# 6.0 功能运行 TFS 构建
衕憶晩安