文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>在mysql中处理时间戳

在mysql中处理时间戳

时间:2010-09-17  来源:luoine

把mysql中时间戳转化成正常时间, 用mysql函数: from_unixtime(数据库time字段,“%Y%m%d”);

例如,按月统计:


  1. select count(id), from_unixtime(select_time,'%Y-%m'as result, from_unixtime(select_time,'%Y')as year, from_unixtime(select_time,'%m'as month 
  2.                 from diray 
  3.                 group by  yearmonth  
  4.                 order by  year descmonth desc 
排行榜 更多 +
爱炫相机

爱炫相机

图像拍照 下载
富翁X富翁

富翁X富翁

音乐节奏 下载
派盟

派盟

生活实用 下载