PHP Convert Timestamp to Readable date/time Example

Jan 01, 2022 . Admin



Hello Dev,

Now let's see example of how to convert timestamp to readable date/time example. We will check how to convert timestamp to readable date/time. This is a short guide on convert timestamp to readable date/time in php. Let's get started with how to convert timestamp to readable date/time in php.

Here i will give you many example how to convert timestamp to readable date/time using php.

Example : 1

This can be achieved with the help of date() function, which is an inbuilt function in PHP can be used to format the timestamp given by time() function. This function returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given.

<?php
    echo date('m/d/Y H:i:s', 1541843467);
?>
Output:
11/01/2022 09:51:07
Example : 2
<?php
    echo date('m/d/Y H:i:s', time());
?>
Output:
Current Time in formatted form

It will help you...

#PHP