: 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.
PHP uses Strtotime to get last month, next month, month's date, Strtotime last month
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
Learn from:http://www.jxbh.cn/newshow.asp?id=1635&tag=2//1. Get the first day and last day of last month. Date(' y-m-01 ',Strtotime('-1 month '))); Date(' Y-m-t ',Strtotime('-1 month ')));//2. Get the first day and last day of the month. Date('
This article describes how PHP obtains the current month and the month and month-end timestamp. Share to everyone for your reference, specific as follows:
Current month
Last month
The key here is the T in the Date
: This article describes how to obtain the number of days of the month in php. For more information about PHP tutorials, see. At work, I often encounter the problem of getting the number of days in a month. I previously solved this problem.
// This
PHP obtains the date (strtotime (), date (), and strtotimedate of the previous month, next month, and this month. PHP obtains the date (strtotime (), date () of the previous month, next month, and this month, suddenly I found a function that was
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
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
PHP Gets the current time (year, month, day, hour, minute, second)
1echo date ("h:i");
Date
(PHP 3, PHP 4)
date-formatting a local time/date
Description
String date (string format [, int timestamp])
Returns a string that is the result of the
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.