Use the function date () to implement the displayed in the format: year-month-day hours: minutes: secRelated Time parameters:A-"AM" or "PM"A-"AM" or "PM"D-A few days, two digits, if less than two digits before the 0; such as: "01" to "31"D-Days of
When I used to solve this problem with ASP is quite simple, the ASP has the corresponding function DateDiff can give two days period interval How many months, how many days and how many seconds. When I searched through the PHP manual I found that
PHP date formatting, date calculation, and obtaining the start and end dates of the current week and month. PHP date formatting and date calculation as well as getting the current week, month header and end date PHP date format and date calculation
PHP date formatting and date calculation and when getting before week, month and end date
PHP date format Sample code:
/** * Format time * $type: Type * $strDate: Time string to be processed * * Year y: four-bit year y: two-bit year * month M:
Web site development We often need to deal with the date, time, in PHP provides a lot of date, time function to facilitate the PHP developers to calculate the date, time, format conversion. So it is necessary to master the PHP date function and to
This article contains the following elements:
1, get the current date and time-how many ways do we have?
2, change the date display mode-date and time display form
3, the conversion of the current date is a Unix timestamp value
4. Change Date
A.
PHP date formatting and date calculation as well as getting the current week, month and tail date
PHP date formatting and date calculation as well as when getting previous week, month tail date
PHP date formatting Sample code:
/** * Format time
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
Local Test Cases:
# there can be no spaces on either side of the equal sign, before the error has been out here
yesterday= ' date-d last-day +%y-%m-%d '
echo $yesterday
curday= ' Date +%y-%m-%d '
echo $curday
echo "Now time: ' Date ' +%y%m%d%T '"
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.