The Unix Timestamp, while efficient for data storage, lacks human readability and appears as a set of integer numbers to users. To make it more user-friendly, it requires conversion into a readable format before displaying it to end-users.
If you don’t perform this conversion directly while selecting rows from the Database Table, you’ll need to handle it programmatically. For example, in PHP, you can utilize the date() function for conversion like so:
$timestamp = 1690768832;
echo "date time : ".date('d-M-Y H:i:s a',$timestamp);
The above code gives the following output:
date time : 31-Jul-2023 02:00:32 am
In this tutorial, we will explore how to convert Unix Timestamp values into a more readable Date Time format when selecting data from a MySQL Database Table. Let’s dive in and make the process of converting Unix Timestamps more accessible and comprehensible.
Read more