<script language="javascript"> function getCurDate() { var d = new Date(); var week; switch (d.getDay()){ case 1: week="星期一"; break; case 2: week="星期二"; break; case 3: week="星期三"; break; case 4: week="星期四
var d = new Date();var date = d.getFullYear() + "年" +(d.getMonth() + 1) + "月" + d.getDate() + "日"; var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份(4位,1970-????)myDate.getMonth()
js获取当前时间 //获取当前时间,格式YYYY-MM-DD function getNowFormatDate() { var date = new Date(); var seperator1 = "-"; var year = date.getFullYear(); var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) {
自PHP5.0开始,用PHP获取系统时间时,时间比当前时间少8个小时.原因是PHP.ini中没有设置timezone时,PHP是使用的UTC时间,所以在中国时间要少8小时. 解决办法: 1.在PHP.ini文件中修改设置. [Date] ; Defines the default timezone used by the date functions date.timezone = Asia/Shanghai 这里真是...可以设置Shanghai,Chongqin,Hong_Ko