addtime 这个属性的“ 值” 是怎么来的? 是什么类型 ? 不知道是什么类型的值,就不知道使用什么函数来转换 ,麻烦楼主说明一下 !

解决方案 »

  1.   

    这个addtime 值是网站会员加数据的时间,应该就是时间类型吧。
      

  2.   

    这个addtime 值是网站会员加数据的时间,应该就是时间类型吧。你先看下addtime字段类型。不要说应该。
      

  3.   

    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'
      

  4.   


    楼主正解 :FROM_UNIXTIME(unix_timestamp,format)  
      

  5.   


    谢谢。但好像SELECT只能查看,如果我想修改呢。?
      

  6.   


    我用了类似的UPDATE语句,但是出来的只有年份,例如只有 2014.