织梦dedecms怎么调用获取当前系统的日期时间星期

查看次数:  编辑:sorry404  时间:2014-07-03 06:55

织梦dedecms怎么调用获取当前系统的日期时间星期几 代码如下

通过 织梦标签调用
{dede:mytime runphp='yes'}

@me=date("Y年 m月 d日");

$weekarray=array("日","一","二","三","四","五","六");  

@me = date("Y年 m月 d日")."  星期".$weekarray[date("w")]; 

{/dede:mytime}

通过 php获取  
 

{dede:php}
 $GLOBALS['thisid'] = intval($refObj->Fields['id']);
{/dede:php}



 

通过js获取

js调用当天是周几:

<script language="JavaScript">

function initArray(){

     this.length=initArray.arguments.length

    for(var i=0;i<this.length;i++)

    this[i + 1] = initArray.arguments[i] 

}

var d=new initArray("<font color=RED>星期日","<font color=black>星期一","<font color=black>星期二","<font color=black>星期三","<font color=black>星期四","<font color=black>星期五","<font color=red>星期六"); 

document.write(d[today.getDay()+1]);  

</script>

 

 

js调用当天日期:

<script language="JavaScript">

today=new Date();

document.write("<font color=black>",today.getFullYear(),"<font color=black>年","<font color=black>",today.getMonth()+1,"<font color=black>月","<font color=black>",today.getDate(),"<font color=black>日 </FONT>");  

</script>