How to get a simple date in php
This article is about how to get a simple date in php. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Get a simple date
The format parameters of the date () function are required, and they specify how the date or time is formatted.
Some characters commonly used in dates are listed below:
D-represents a day of the month (01-31)
M-represents month (01-12)
Y-represents year (four digits)
1-indicates a day of the week
Other characters, such as "/", "." Or "-" can also be inserted into characters to add other formats.
The following example formats today's date in three different ways:
Example
Thank you for reading! This is the end of this article on "how to get a simple date in php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!