Mondayecho Date (' y-m-d ', (Time ()-((Date (' W ') ==0?7:date (' W ') ')-1) *24*3600)); W is the number form of the day of the week, where 0 is SundayThis Sundayecho Date (' y-m-d ', (Time () + (7-(' W ') ==0?7:date (' W ')) *24*3600)); Also use W
-The 1 Monday output is the time of this Monday, which is very strange.-1 Monday output is the time of this Monday, which is very strange.
Reply content:
-1 the Monday output is the Monday time, which is very strange.
Because foreigners think
Start date of the current time week (as of Monday) Select DATEADD (Week,datediff (Week,0,getdate ()), 0)Last week start: Select DATEADD (Week,-1,dateadd (Week,datediff (Week,0,getdate ()), 0))Last week start: Select DATEADD (Week,-2,dateadd
Last Monday
String Getlastmondayyyyymmddhhmmss () {
MonDay =-6;
SimpleDateFormat ("Yyyy-mm-dd 00:00:00"); Set the time format
Calendar resulttime = Calendar.getinstance ();
DayWeek = Resulttime.get (Calendar. Day_of_week);//Gets
This MondayEcho date ('Y-m-d', (Time ()-(date ('W') = 0? 7: Date ('W')-1) * 24*3600); // W indicates the number of weeks. 0 indicates Sunday.This SundayEcho date ('Y-m-d', (Time () + (7-(date ('W') = 0? 7: Date ('W') * 24*3600); // W is also used,
-1 Monday output is this Monday time, very strange
Reply content:
-1 Monday output is this Monday time, very strange
Because the foreigner thinks "this Monday" is next Monday, "Last Monday" is this MondayJust "-2 Monday", or "Monday last week"
Oracle query statement from last Monday to weekend
[SQL] -- Oracle obtains the SQL statement from the last Monday to the weekend -- in this way, select to_char (to_date ('123 ', 'yyyymmdd'), 'D') from dual; -- result: 6 Note: 2013.09.06 is Friday,
Php date instance: get last week, this week, last month, this month, this quarter, last quarter
For example, php obtained last week, this week, last month, this month, this quarter, and the last quarter.
This week, 1st, returns the result format: 2014-5-5 0:00:00public static DateTime Getmondaydate (){DateTime Dt=datetime.now;int today= (int) dt. DayOfWeek;if (dt. Dayofweek.tostring ()! = "Sunday")//You can also use the today!=0{Return dt. AddDays (1
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.