我的test表中字段 data1 字段的属性已经设置为 timestamp(8)了 用now函数写入。为什么查询出来的结果还是 14位的
2009-06-02 10:00:31  俺只想要2009-06-02这种格式啊 

解决方案 »

  1.   

    mysql> select date(current_timestamp());
    +---------------------------+
    | date(current_timestamp()) |
    +---------------------------+
    | 2009-06-02                |
    +---------------------------+
    1 row in set (0.00 sec)mysql> select date_format(current_timestamp(),'%Y-%m-%d');
    +---------------------------------------------+
    | date_format(current_timestamp(),'%Y-%m-%d') |
    +---------------------------------------------+
    | 2009-06-02                                  |
    +---------------------------------------------+
    1 row in set (0.00 sec)