: This article describes how to obtain the number of days of the current month, the first and last days of the current month, the first day of the previous month, and the last day of the previous month. if you are interested in the php Tutorial,
Php returns the number of days of the current month and the date array by month and month.
This example describes how to obtain the number of days of the current month and the date array by using php. We will share this with you for your reference.
This article mainly introduces the method by which PHP obtains the number of days of the month and the date array according to the date, related to the relevant judgment, conversion and the traversal operation of the character and array of PHP, and
The example of this article is about how to get the last days of month, the maximum days and the number of days. Share to everyone for your reference, specific as follows:
title page
function Getlastday (year,month)
{
var new_year =
This example describes how PHP obtains the number of days and date arrays by month. Share to everyone for your reference, as follows:
function Get_day ($date) { $tem = explode ('-', $date);//Cut date get year and month $year = $tem [' 0 '];
Original link: http://www.jb51.net/article/44468.htm
First, get the last day of the month (possibly 28/29/30/21) problem, the idea is simply to get the first day of the next month, the number of milliseconds from 1970, and then subtract the number
TodaySELECT * FROM table name where To_days (Time field name) = To_days (now ());YesterdaySELECT * FROM table name WHERE to_days (now ())-To_days (Time field name) 7 daysSELECT * FROM table name where Date_sub (Curdate (), INTERVAL 7 day) Nearly 30
Mysql query today, yesterday, last 7 days, last 30 days, this month, the data method of the last month said there is an article table article, storing the time for adding an article to the article is the add_time field, this field is of the int (5)
Mysql query today, yesterday, last 7 days, last 30 days, this month, last month data, mysql January
Recently, the data record query function for the current month was used in the project. The original idea was to construct a period of time in the
During registration, the number of days of the month changes with the change of the month. this small function is used in many places! & Lt; 5 & gt; change PHP code [php] & lt; selectname & quot; month & quot; id & quot; month & quot; onchange &
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.