Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php to formate date from database

date_default_timezone_set('asia/karachi'); // set timezone
$timestamp = $row['last_login']; // get current epoch time
$format = "Y-m-d h:i:s a"; // format for date output
$formatted_date = date($format, $timestamp); // convert timestamp to format
print($formatted_date);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #formate #date #database
ADD COMMENT
Topic
Name
5+2 =