How to convert the timestamp into the year, month, day, hour and second by php
Editor to share with you how php time stamp into the year, month, day, minute and second, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!
In php, you can use the date () function to convert the timestamp into the year, month, day, minute and second. The function is to format the timestamp and convert it into a human-readable time format; the syntax "date (" Y-m-d H:i:s "," timestamp ").
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, you can use the date () function to convert the timestamp into the year, month, day, hour, minute and second.
The date () function formats the timestamp, converts it to a human-readable time format, and returns a formatted date string.
Example:
Output result:
Description:
Four-digit representation of Y-year
Two-digit representation of y-year
The number of m-month (from 01 to 12)
Short text representation of M-month (represented by three letters)
N-month numbers without leading zeros (1 to 12)
H-12-hour system with leading zeros (01 to 12)
H-24-hour system with leading zeros (00 to 23)
I-score, with leading zeros (00 to 59)
S-seconds with leading zeros (00 to 59)
U-microseconds (new in PHP 5.2.2)
The above is all the contents of the article "how php converts timestamps into hours, months, days and seconds". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!