A simple implementation of PHP timestamp and specific time conversion, php specific time conversion. A simple implementation of PHP timestamp and specific time conversion. php specific time conversion has three built-in functions: time () to obtain UNIX system timestamp mktime (hour, minute, second, month, day, year) will refer to the simple implementation of PHP timestamp and specific time conversion, php specific time conversion
Three built-in functions:
Time () // Obtain the UNIX system timestamp mktime (hour, minute, second, month, day, year) // Convert the specified time to the timestamp date (time format, timestamp) // converts the timestamp into a time for easy reading.
Time-> date:
$ Now = time (); echo "the timestamp is ". $ now; echo "created on ". date ("Y-m-d h: I: s", $ now); output: The time stamp is 1404610907. the creation date is 09:41:47.
Mktime-> date:
$ D = mktime (9, 41, 47, 7, 6, 2014); echo "the timestamp is ". $ d; echo "created on ". date ("Y-m-d h: I: s", $ d); output: The time stamp is 1404610907. the creation date is 09:41:47.
Note:
Generally, the time function is used to obtain the current timestamp by default during registration or login. when a business requires a specific time, the mktime function can be used to convert it to a specific timestamp according to the specific time, the date function can reverse the timestamp to a specific time for easy viewing.
The simple implementation of the above PHP timestamp and specific time conversion is all the content that I have shared with you. I hope you can give us a reference and support for the customer's house.
Three built-in functions: time () // Obtain the UNIX system timestamp mktime (hour, minute, second, month, day, year...