FROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format) Returns a representation of the unix_timestamp argument as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context. The value is expressed in the current time zone. unix_timestamp is an internal timestamp value such as is produced by the UNIX_TIMESTAMP() function. If format is given, the result is formatted according to the format string, which is used the same way as listed in the entry for the DATE_FORMAT() function. 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'
-> '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'
楼主正解 :FROM_UNIXTIME(unix_timestamp,format)
谢谢。但好像SELECT只能查看,如果我想修改呢。?
我用了类似的UPDATE语句,但是出来的只有年份,例如只有 2014.