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 returns the current date or the specified date is the day of the week. Php returns the current date or the specified date is the day of the week. php obtains the code for the current PHP day of the week: Copy the code as follows: date (l ); for
Php obtains the day of a day, the day of the week, and the date corresponding to the day of the week and the day of the week.
$ Today = date ("Y-m-d ");
Echo $ today; // you can get the number of today. Output
// Define an array first.
$
In-depth introduction to PHP date format: leap year, week, day. PHP itself is a simple and powerful language, and the PHP date format is quite common. so I studied the PHP date format and will share it with you here, I hope that PHP itself is a
This example describes how to convert the date format of the PHP date function. During website development, we often need to process the date and time. in PHP, many date and time functions are provided to facilitate PHP developers to calculate and
Php date instance: get last week, this week, last month, this month, this quarter, last quarter
For example, php obtained last week, this week, last month, this month, this quarter, and the last quarter.
O-w Week converted to the last day of the normal date week public function Weektodate ($oW) { $oW = explode ("-", $oW); Split o-w Zhou Weihin and weeks $year = $oW [0];//year $week = $oW [1];//week number
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
During website development, we often need to process the date and time. in PHP, many date and time functions are provided to facilitate PHP developers to calculate and convert the date and time formats. Therefore, it is necessary to master the PHP
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.