php 赋值,时间函数

$new_data['xaxis'] = $login_data['xaxis'] = "Date";
$new_data['yaxis'] = $login_data['yaxis'] = "People";


 $login_data['xaxis'] = "Date";
and $new_data['xaxis'] = $login_data['xaxis']


mktime() 当前时间戳
时间点加n天
date('Y-m-d',strtotime('n days',$time));     //$time是Y-m-d格式

使用strtotime("sunday/monday等的区别")
2011-08-17 星期三
monday:2011-08-22
last monday:2011-08-15
next monday:2011-08-22

2011-08-15 星期一
monday:2011-08-15
last monday:2011-08-08
next monday:2011-08-22

2011-08-09 周二
sunday:2011-08-14
last sunday:2011-08-07
next sunday:2011-08-14

2011-08-14 周日
sunday:2011-08-14
last sunday:2011-08-07
next sunday:2011-08-21


//第几周 星期几 换算日期
function get_workday($week_n,$workday_n){
	$date_11=date('w',mktime(0,0,0,1,1,date('Y')));		//1月1是周几		第几周是从周一计算 年初的不是周一的计算到上年52周
	$work_date=date('Y-m-d',mktime(0,0,0,1,1,date('Y'))+($week_n)*7*86400+($workday_n-$date_11)*86400);
	return $work_date;
}


date('Y-m-d',mktime(0,0,0,$month+1,0,$year));		//所在月末
date('Y-m-d',mktime(24,0,0,$month,0,$year));		//所在月初


你可能感兴趣的:(时间函数)