PHP retrieves the first and last days of the week. // The first and last days of the week. $ date = new & nbsp; DateTime (); $ date-& gt; modify ('This & nbsp; week '); $ first_day_of_week = $ date-& gt; format ('Y-m-D'); $ date-& gt; modify PHP get
PHP gets the first and last day of the week
The first and last day of the week$date =new DateTime ();$date->modify (' this week ');$first _day_of_week= $date->format (' y-m-d ');$date->modify (' This week +6 days ');$end _day_of_week= $date->format
Php obtains the day of a day, the day of the week, and the date corresponding to the day of the week and the day of the week.
$ Today = date ("Y-m-d ");
Echo $ today; // you can get the number of today. Output
// Define an array first.
$
Php gets the day of a day, the day of the week, and the date corresponding to the day of the week and the day of the week. Php returns the day of a day, the day of a week, and the date $ todaydate (Y-m-d) corresponding to Monday and next Monday.
Echo ' The first day of the week (Sunday is the beginning of the week): '. Date (' y-m-d ', Time () -86400*date (' W ')). '';
Echo ' The first day of the week (Monday is the beginning of the week): '. Date (' y-m-d ', Time () -86400*date (' W
Php:This week an echodate(' y-m-d ',(Time ()-(date(' W ') ==0?7:date// W is the number form of the day of the week, where 0 is Sunday this Sunday Echo Date (' y-m-d ', (time () + (7-)(Date(' W ') ==0?7:date// same as W, with current and Sunday
I have been learning PHP for a long time. I would like to share my little experience with you here. PHP is a server scripting language used to create dynamic web pages. Like ASP and ColdFusion, users can use PHP and HTML to write WEB pages. When a
This article introduces, using PHP to get this week, the first day of this month and the last day time stamp code, the need for a friend to make a reference.Get the time stamp for this week, the first day of the month, and the last day with PHP.1,
PHP shows today is the day of the week with the code for each day of the year
Public Function Getpart ($part) {$source = $this->timestamp;Switch ($part){Case ' yy ': $result = intval (Date ("Y", $source)); Break YearsCase ' mm ': $result = intval
The first and last day of the week
Copy CodeThe code is as follows:
$date =new DateTime ();
$date->modify (' this week ');
$first _day_of_week= $date->format (' y-m-d ');
$date->modify (' This week +6 days ');
$end _day_of_week= $date->format ('
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.