mysql 将时间戳直接转换成日期时间:
FROM_UNIXTIME( ):转为时间戳类型时间
UNIX_TIMESTAMP( ) :返回长整形类型时间
from_unixtime()是MySQL里的时间函数
select count(id) AS number,from_unixtime(reg_date, '%y-%m-%d') AS time from `gcar_coupon_user` reg_date GROUP BY time ORDER BY time desc以上例子是sql语句的例子,直接能将mysql的时间戳类型转换成日期格式

mysql 将日期时间格式化时分秒:
date_format(date,format)
select count(nid) AS number,date_format(pub_date, '%y-%m-%d') AS time from `hq_news` pub_date GROUP BY time ORDER BY time desc
以上例子是,直接能将mysql的日期时间的时分秒给格式化了!

获取当前时间到23:59:59秒时间戳: eco strtotime($btime=date('Y-m-d'.'23:59:59',time()));
转载请注明转自:运达's blog 原文地址:http://www.yunda51.com/1557.html