PHP obtains the date (strtotime (), date () of the previous month, next month, and this month ()). When I was writing a program today, I suddenly found a function that was written a long time ago to get the number of days of the month. The classic switch version, but when I got the number of days of the previous
When I was writing a program today, I suddenly found a function that was written a long time ago to get the number of days of the month. The classic switch version, but when I got the number of days of the previous month, I only set the month to 1, it is estimated that it was too difficult at the time, and then I saw a sense of treasure. I wanted to deal with it
Because the job needs to get last month, next month, this month's date, special from the website found the implementation code, special sharing, easy to use friends
Write the program today, suddenly found a long time to write a long time to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put the
PHP Gets the date of last month, next month, month (Strtotime (), date ()), strtotimedate
Write the program today, suddenly found a long time to write a long time to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put the
Obtain the day of a month, the day of the month, and the day of the month.[Javascript]Var Nowdate = ("2012-11-22"). split ("-"), // obtain a dateNowYear = parseInt (Nowdate [0]), // a yearNowMonth = parseInt (Nowdate [1]), // a monthNowday = parseInt (Nowdate [2]), // one dayDate = new Date (),Weekday = new Array (7 );Weekday [0] = "Sunday ";Weekday [1] = "Monday
Today, when I write the program, suddenly found a long time ago to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put the month-1, I guess it was too sleepy, and then see a kind of creepy feeling, would like to deal with, But I think there are some super convenient way, so I found the following version, made a little change.
Get this mon
Because the work needs to obtain the last month, next month, this month's date, special from the website to find the implementation code, special sharing, easy to need friends Today, when I write the program, suddenly found a long time ago to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put
1.get the first day and last day of the month.echo Date (' y-m-01 ', Strtotime ('-1 month '));echo "echo Date (' Y-m-t ', Strtotime ('-1 month '));echo "2.get the first day of the month and the last day.$BeginDate =date (' y-m-01 ', Strtotime (date ("y-m-d"));Echo $BeginDate;echo "echo Date (' y-m-d ', Strtotime ("$BeginDate +1
Write the program today, suddenly found a long time to write a long time to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put the month-1, it was too sleepy, then saw a kind of creepy feeling, would like to deal with again, But I think there is something super convenient way, so found the following version, made a little change.
Get thi
Today, when I write the program, suddenly found a long time ago to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put the month-1, I guess it was too sleepy, and then see a kind of creepy feeling, would like to deal with, But I think there are some super convenient way, so I found the following version, made a little change.
Get this mon
Get this month's date: code as follows:1 functionGetMonth ($date){2 $firstday=Date("y-m-01",Strtotime($date));3 $lastday=Date("Y-m-d",Strtotime("$firstday+1 month-1 Day "));4 return Array($firstday,$lastday);5}$firstday is the first day of the month, if the year is 2014-2, then the $firstday will be 2014-02-01, then according to the $firstday plus one months is 2014-03-01, another day is 2014
--the first day of last month SELECT CONVERT(CHAR(Ten),DATEADD(Month,-1,DATEADD(DD,- Day(GETDATE())+1,GETDATE())),111) SELECT DATEADD(MM,DATEDIFF(MM,0,DateAdd(Month,-1,getdate())),0) --the last day of last month SELECT CONVERT(CHAR(Ten),DATEADD(MS,-3,DATEADD(MM,DATEDIFF(MM,0,getdate()),0)),111)+'23:59:59' Select DateA
/*************************************** ************************* *** Auther: liuyongahui* ***** Date:* ** Language: C**************************************** ***********************//*Question 19: classical question: there is a rabbit, from birthEvery month, a rabbit was born every three months, and every day after the third monthA rabbit was born every month. If the Rabbit does not die, how many rabbits
Javascript get this week, this month, this season, this year, last month, last week, last quarter, last year, last two weeks, last month
Function datechange (name) {var begintimeobject = document. getelementbyid ("begintime"); var endtimeobject = document. getelementbyid ("endtime"); var begintime; var endtime; var now = new date (); var
Label:1. First day of last monthSELECT CONVERT (CHAR), DATEADD (Month,-1,dateadd (Dd,-day (GETDATE ()) +1,getdate ()), 111)2. Last day of last monthSELECT CONVERT (CHAR), DATEADD (Ms,-3,dateadd (mm, DATEDIFF (Mm,0,getdate ()), 0)), 111) + ' 23:59:59 '3, the first day of the monthSELECT CONVERT (CHAR), DATEADD (Dd,-day (GETDATE ()) +1,getdate ()), 111)4, the last day of this monthSELECT CONVERT (CHAR), DATEADD (Ms,-3,dateadd (Mm,datediff (M,0,getdate (
The development of commonly used, recorded down, provided to the need for reference friends!
--1 at the end of the month.
DECLARE @startdate datetime
Select @startdate =dateadd (Dd,-datepart (Dd,getdate ()) +1,getdate ())
Select SUBSTRING (Convert (varchar, @startdate, 23), 1,10)
DECLARE @enddate datetime
Select @enddate =dateadd (Dd,-datepart (Dd,getdate ()), DateAdd (Mm,1,getdate ())
Select SUBSTRING (Convert (varchar, @enddate, 23), 1,10)
-
What we bring to you today is a very common shining effect, and the production method is simple. I hope you like it. Create a 400 x 100% PX document; open the filter-rendering-lens Halo, center in the middle of the canvas, brightness 300, lens
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.