In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to obtain the current php is a few months, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
In PHP, you can use the date () function to get the current month, which is used to format the time and date. When the parameter is set to "m", you can get the month number with a leading zero, and the syntax is "date (" m ")".
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer.
How does php get the current month?
The PHP date () function is used to format the time / date.
The PHP date () function formats the timestamp into a more readable date and time.
A timestamp is a sequence of characters that indicates the date / time of a given event.
Grammar
String date (string $format [, int $timestamp])
Parameter description
Format is required. Specifies the format of the timestamp.
Timestamp is optional. Specify a time stamp. The default is the current date and time.
The first required parameter of the date () function, format, specifies how the date / time is formatted.
Here are some available characters:
D-represents the day of the month (01-31)
M-represents month (01-12)
Y-represents year (four digits)
For a list of all the characters available in the format parameter, please refer to our PHP Date reference manual, the date () function.
You can insert other characters between letters, such as "/", "." Or "-", so you can add additional formats:
The output of the above code is as follows:
Thank you for reading this article carefully. I hope the article "how to get the current month of php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.