现在的位置: 首页 > 综合 > 正文

php获得时间

2011年11月19日 ⁄ 综合 ⁄ 共 606字 ⁄ 字号 评论关闭

php得到时间

$yes_Date = date('Y-m-d', time()-86400);

$y_m = date('Y-m', strtotime($yes_Date));

$yes_Date2= date('Ymd', time()-86400);

$yes_m= date('Y-m', time()-86400);

$titletime = date('Ymd', strtotime($yes_Date));

$now = strtotime($startDate);

$date_before_yesterday = date('Y-m-d',time()-2*86400);

$dayForCompare = array();

$dayForCompare[0] = $yes_Date ;

$dayForCompare[1] = $date_before_yesterday;

strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。

time() 函数返回当前时间的 Unix 时间戳。

echo date('Y-m-d H:i:s',strtotime('+1 day')),输出结果:2012-03-23 23:30:33(会发现输出明天此时的时间)

microtime() 函数返回当前 Unix 时间戳和微秒数。

原文:

http://www.cnblogs.com/MichaelZhangX/archive/2012/07/24/2607503.html

抱歉!评论已关闭.