douqie1852 2013-03-26 15:56
浏览 24
已采纳

从MYSQL表中提取没有时间的日期[复制]

This question already has an answer here:

I am using the followup procedure to display date from mysql tabe:

<? echo $rrow[encoded_date]; ?>

Now the format of encoded_date cell is: 2013-03-20 01:52:39 .

My question is how to extract only the date without the time.

</div>
  • 写回答

2条回答 默认 最新

  • douzi7711 2013-03-26 16:00
    关注

    You can do it with PHP:

    $yourDateTime = "2013-03-20 01:52:39";
    date('Y-m-d', strtotime($yourDateTime));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?