Added: 18th of December 2015
Updated On: 6th of October 2023
Viewed: 3,886 times
To convert a unix timestamp to date and time using php we use the php date() and time() functions
The time() function returns the current time as a Unix timestamp (the number of seconds elapsed since January 1 1970 00:00:00 GMT).
In our code below we are displaying the date and time in the following format
(d=day of the month)(F=month)(Y=year, 4 digits) - (G=hour)(i=minutes)(s=seconds)(a=am or pm)