- //The deadline for getting the nearest Sunday corresponding to the year, month and day may span years, months and weeks
- function GetClearWeek() {
- $year_month_day_over = array();
- $year = date('Y' ); //Four-digit year
- $month = date('n'); //1 to 12
- $day_of_month = date('j'); //The day of the month from 1 to 31
- $day_of_week = date('N'); //1-7 days of the week
- $day_of_year = date('z')+1; //1-366 days of the year
- $days_of_month = date('t' ; ; 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;
- }
-
-
- Copy code
-
-
PHP
|