We know that when the default tag {$inputtime} is used on the content page, the format displayed is similar to 2014-03 -24 20:00:43 This kind of display effect has a very bad impact on the image of the collected website, because the time of collecting and publishing the website is very close to each other, and others will know it is the collected website at a glance.
So, can we only display the release date 2014-03-24? The answer is of course yes! Just use the tags below. The principle is to return the original value of the time first, and then use the DATE function to convert it.
Copy code
The code is as follows:
Subsequent addition, after testing, the label {date('Y-m-d',strtotime($updatetime))} is also possible, but the article needs to be regenerated before it will take effect, otherwise the format of 1970-01-01 will be displayed, which should It may be caused by the fact that the article entered for the first time does not have the last update time.
Note: For more exciting tutorials, please pay attention to the Bangke Home Web Design Tutorial column,