Use strtotime(..)
:
$timestamp = strtotime($mysqltime);
echo date("Y-m-d H:i:s", $timestamp);
Also check this out (to do it in MySQL way.)
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_unix-timestamp
More Related Contents:
- MySQL datetime fields and daylight savings time — how do I reference the “extra” hour?
- Using MySQL’s TIMESTAMP vs storing timestamps directly
- Formatting an SQL timestamp with PHP
- Storing time information: Timezone required?
- save user images in MYSQL database by which method? [closed]
- Im trying to create some temporary tables in mysql using php
- the update query just update the last row and affect other with it’s value
- How to insert images into a database using PHP [closed]
- How to apply bindValue method in LIMIT clause?
- Importing CSV data using PHP/MySQL
- Convert latin1 characters on a UTF8 table into UTF8
- Find total number of results in mySQL query with offset+limit
- mysql_fetch_array() expects parameter 1 to be resource problem [duplicate]
- PDO multiple queries
- Using strtotime for dates before 1970
- How to efficiently find the closest locations nearby a given location
- Turn database result into array
- NOW() function in PHP
- Update query with PDO and MySQL
- (mysql, php) How to get auto_increment field value before inserting data?
- Trying to get property of non-object – CodeIgniter
- PHP to store images in MySQL or not?
- UTF-8 character encoding battles json_encode() [duplicate]
- Using utf8mb4 with php and mysql
- how do I get month from date in mysql
- How do I save PHP session data to a database instead of in the file system?
- MySQL, how to insert null dates
- Escaping SQL queries in Codeigniter
- Subtracting a certain number of hours, days, months or years from date
- How to write a stored procedure in phpMyAdmin?