PHP函数 function switchInfor(infor1,infor2){ $mor_time = date(Y-m-d). 8:00:00; $nin_time = date(Y-m-d).17:00:00; $n_time = date(Y-m-d H:i:s); $mor_time_format = strtotime($mor_time); $nin_time_format = strtotime($nin_time); $n_time_format
PHP函数
function switchInfor(infor1,infor2){
$mor_time = date("Y-m-d")." 8:00:00";
$nin_time = date("Y-m-d")."17:00:00";
$n_time = date("Y-m-d H:i:s");
$mor_time_format = strtotime($mor_time);
$nin_time_format = strtotime($nin_time);
$n_time_format = strtotime($n_time);function switchInfor(infor1,infor2,idinfor){
//infor1 早上8点到晚上5之间的信息var myDate = new Date(); //Date对象
var Year = myDate.getFullYear();var Mouth = myDate.getMonth();
var Dat = myDate.getDate();var mor_time = new Date(Year,Mouth,Dat,8,0,0).getTime();
var nin_time = new Date(Year,Mouth,Dat,17,0,0).getTime();var now_time = myDate.getTime();
//alert(mor_time+'-'+nin_time+'-'+now_time);
if((now_time-mor_time>=0)&&(nin_time-now_time)>=0)