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_
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
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 (Date ("M", $source)); Break MonthCase ' dd ': $result = intval (Date ("D", $source)); Break DayCase ' W ': $result =
The first and last day of the week
Copy Code code as follows:
$date =new DateTime ();
$date->modify (' this week ');
$first _day_of_week= $date->format (' y-m-d ');
$date->modify (' This week for +6 days ');
$end _day_of_week= $date->format (' y-m-d ');
After testing modity do not know w
Java obtains the last day of a week and the last day of java.
Package test; import java. text. simpleDateFormat; import java. util. calendar;/*** ClassName: LastDayOfWeek * @ Description: TODO * @ author Owen * @ date July 15, December 22, 2015 */public class LastDayOfWeek {/*** obtain the last day of a
. the first seven days of logs include yesterday.
For example, we will collect data from July 1.
select * from bean where date(usedate) >= date_sub(curdate(),interval 7 day)
and date(usedate)
Week is used on the Internet to collect weekly information, which can only be used for 5 days. This method is used because it does not meet the requirements.
Collect logs of a previous
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 (' y-m-d ');
After testing modity do not know what to do, in the time to f
Label:Oracle gets this week, this month, the season, the first day of the year, and the last day --This week Select Trunc (sysdate, ' d ') + 1 from dual; Select Trunc (sysdate, ' d ') + 7 from dual; --This month Select Trunc (sysdate, ' mm ') from dual; Select Last_day (trunc (sysdate)) from dual; --this season Select
Package Com.goldcn.jzgmanageplat.b2b.controller;Import Java.text.SimpleDateFormat;Import Java.util.Calendar;Import Java.util.Date;Import Java.util.GregorianCalendar;Import Com.goldcn.common.utils.CommonUtils;public Class AA {public static void Main (string[] args) throws exception{AA tt = new AA ();System.out.println ("Get last 1st period:" + tt.getyesterday ());System.out.println ("Get last week Giges period:" + tt.getpreviousweeksunday ());}public s
DB2 installation-on the first day, I personally installed IBM DB2 and installed it with my own database, but I found a lot of problems when creating a remote connection. I don't know how to proceed, I tried a lot of searching on the Internet, but I didn't make it clear on the Internet. I finally got it done. In fact, the procedure is very simple: the
Share two PHP function codes that are occasionally more useful:
(1) PHP gets the first and last day of the week of the specified date, with the following specific code:
function GetDays ($day) {$lastday =date (' y-m-d ', Strtotime ("$day Sunday"));$firstday =date (' y-m-d ', Strtotime ("$lastday-6 Days"));Return 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
Mysql queries the data of bitsCN.com every other day for one day and one week.
Mysql queries data from one day, one week, and the other day
-- Query a day
Select * from tbl_order
The last Sunday deadline for the date of month and year may cross the moon across the years
function Getclearweek () {
$year _month_day_over = Array ();
$year = Date (' Y '); Four-bit year
$month = Date (' n '); 1 to 12
$day _of_month = Date (' j ');//1-The day of 3 January
$day _of_week = Date (' N ');
/*Calculate the day of the week by entering the day of the month, calculate how many days of the year it is, and determine whether the year is a leap years*/#include using namespace Std;struct TIME{int year;int month;int day;unsigned int weekday;};void Initialtime (time T);//input initialization timesvoid Show (Time
Tags: io ar strong SP art C on CTI RUfn_getweekfirstandendday gets the first and last day of the week on the specified dateALTER FUNCTION [dbo]. [Ufn_getweekfirstandendday] (@tmpDate DATETIME)RETURNS @tmpTable TABLE (FirstDay DATETIME,Endday DATETIME)AsBEGININSERT into @tmpTableSELECT A.firstday,b.endday from (SELECT 1 as Id,dateadd (wk, DATEDIFF (wk,0, @tmpDate), 0) as FirstDay) ALeft JOIN (SELECT 1 as Id,
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.