Friday, April 18, 2008

convert unix_timestamp to normal date value

mysql>

SELECT FROM_UNIXTIME(875996580);

Result=>
FROM_UNIXTIME(875996580)
1997-10-04 13:23:00



SELECT FROM_UNIXTIME(875996580) + 0;

Result=>
FROM_UNIXTIME(875996580) + 0
19971004132300.000000



SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y %D %M %h:%i:%s %x');

Result=>
FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y %D %M %h:%i:%s %x')
2007 22nd July 07:46:11 2007

No comments: