echo date("Y-m-d",strtotime(array_shift(explode('.','2007-01-12 19:15:58.242166+08'))));
output :  2007-01-12

解决方案 »

  1.   

    自己找到了答案substr($result,0,10)
    显示: 2007-01-12
    楼上的谢谢了~~~
      

  2.   

    date('Y-m-d',strtotime($str))
    即可,使用substr是决定于数据库的日期格式设定的,
    设定改变后有可能不正确。
      

  3.   

    楼上的“hello”为什么我一用date得到的就是1969年呢?不是实际的时间。
      

  4.   

    to xuzuning(唠叨)
    时差问题怎么解决好~
      

  5.   

    php5.2以下
    $t = '2007-01-12 19:15:58.242166+08';
    echo date('Y-m-d H:i:s', strtotime($t));php5.2
    $t = '2007-01-12 19:15:58.242166+08';
    echo date('Y-m-d H:i:s', strtotime($t.' '.substr($t,-3).' hour'));