I have a unix timestamp that I would like to convert using mysql if possible. I'd like to have:
Mon. May 21st 2009
I can of course do this with PHP but why if I can have the database do it. Does a function exist for this?
Thanks.
I have a unix timestamp that I would like to convert using mysql if possible. I'd like to have:
Mon. May 21st 2009
I can of course do this with PHP but why if I can have the database do it. Does a function exist for this?
Thanks.
You can look at FROM_UNIXTIME()
mysql> SELECT FROM_UNIXTIME(1196440219);
-> '2007-11-30 10:30:19'
mysql> SELECT FROM_UNIXTIME(1196440219) + 0;
-> 20071130103019.000000
mysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), '%Y %D %M %h:%i:%s %x');
-> '2007 30th November 10:30:59 2007'
To see what specifier you can use, there's a table at this location.