PHP gets days of the week and dates of Monday and next Monday for this week
$today =date ("y-m-d");
echo $today;//You can get the date today. Output 2014-9-29
Define an array first.
$rows =array ("Day", "one", "two", "three", "four", "five", "
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.
PHP gets this week's Monday specific date method, PHP gets this Monday
This example describes how PHP gets the exact date of the week Monday. Share to everyone for your reference. Specific as follows:
Private Function Mondaytime ($timestamp =0, $is
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 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
-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"
How PHP gets the exact date of the week Monday
This article mainly introduces the method of PHP to get the specific date of this week Monday, involving PHP operation skills for the date, very practical value, interested friends can integrate the
1 ORACLE mid-week related knowledge description 1.1 Date formatting functions To_char (X [,FORMAT]) : Press X toFORMATThe format is converted into a string. X is a date,FORMATis a format string that specifies the format in which X is
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.