|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
How to convert MYSQL into Readable PHP timestamp I have timestampt format in Mysql which is of 15 field and that is using date('F d Y', $timestamp); but when i used this format in my programming it won't execute. I am aware about the DATE_FORMAT() function in Mysql but I would like to know if there is a way to do this in PHP? |
#2
| |||
| |||
Re: How to convert MYSQL into Readable PHP timestamp If you wanted to get an output into mysql timestamp you need to use the following the query i.e.SELECT DATE_FORMAT(time, '%F %d %Y') as new_time,table.* FROM table The new_time would be the formatted timestamp and the time you are using will be the the mysql timestamp. |
#3
| |||
| |||
Re: How to convert MYSQL into Readable PHP timestamp I have gone through some book reading and I found that date timestamp does not work according to requirement it shows totally different output but date it also doesn't work on a TIMESTAMP field instead of that it works on a DATE field, when i tried doing that It does formatting the date on a TIMESTAMP field but it gives a wrong date. For example: $timestamp = '20050420118004'; $date = date("F-d-Y", $timestamp); print($date); // Returns January-18-2038 when it should be March-11-2005 |
![]() |
|
Tags: date format, mysql, php, php timestamp, timestamp |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to convert math text PDF format to Kindle readable format | The#Gaelic | Portable Devices | 7 | 23-02-2012 12:09 PM |
How to convert UTC timestamp value to date and time | AsceTic! | MS Office Support | 2 | 02-02-2012 07:14 PM |
How to convert UNIX timestamp to MySQL | Warner | Software Development | 2 | 16-05-2009 08:20 PM |
Criteria with timestamp in MySQL | Kirt | Software Development | 3 | 09-05-2009 12:09 PM |