RE: mysql timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> how do i change the format of a MySQL timestamp (i.e hh:mm:ss
DD/MM/YYYY
> instead of YYYYMMDDhhmmss) retrieved from a mysql database with php?

Use

SELECT TO_UNIXTIME(your_column) FROM table ...

And then use date() in PHP to format the result to your liking.

Or, you can use DATE_FORMAT() in your query to format the result to your
liking.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux