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 related days
JS:
//This Monday function showweekfirstday ()
{
var nowdate=new Date ();
var weekfirstday=new Date (nowdate-(Nowdate.getday () +6) *86400000);
M=number (Weekfirstday.getmonth ()) +1
return Weekfirstday.getyear () + "-" +m+ "-" +weekfirstday.getdate ();
}
Last day of the week
This Sunday
function Showweeklastday ()
{
var nowdate=new Date ();
var weekfirstday=new Date (nowdate-(Nowdate.getday ()+6) *86400000);
var weeklastday=new Date ((weekfirstday/1000+6*86400) *1000);
M=number (Weeklastday.getmonth ()) +1
return weeklastday.getyear () + "-" +m+ "-" +weeklastday.getdate ();
}
JS, php the first day of the week and the last day of the week