87,993
社区成员




<script type="text/javascript">
<!--
function getTimeString()
{
var d, s = "当前本地时间为: ";
var c = ":";
d = new Date();
s += ((d.getHours()<10)?"0":"") + c; s += ((d.getMinutes()<10)?"0":"") + d.getMinutes() + c;
s += ((d.getSeconds()<10)?"0":"") + d.getSeconds();
return(s);
}
document.write(getTimeString());
//-->
</script>
<html>
<head>
<script language="javascript">
function ini(){
var oDate = new Date(2009, 02, 27, 15, 00, 12).Format("yyyy-MM-dd hh:mm:ss") ;
alert("oDate="+oDate);
var oDate_Format = new Date(2009, 02, 27, 15, 00, 12).Format("hh:mm:ss");
alert("oDate_Format="+oDate_Format);
}
// 日期类型格式化方法的定义
Date.prototype.Format = function(fmt)
{ //author: meizz
var o = {
"M+" : this.getMonth()+1, //月份
"d+" : this.getDate(), //日
"h+" : this.getHours(), //小时
"m+" : this.getMinutes(), //分
"s+" : this.getSeconds(), //秒
"q+" : Math.floor((this.getMonth()+3)/3), //季度
"S" : this.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt))
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)
if(new RegExp("("+ k +")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
}
</script>
</head>
<body onLoad="ini()">
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<script type="text/javascript">
<!--
function getTimeString()
{
var d, s = "当前本地时间为: ";
var c = ":";
d = new Date();
s += d.getHours() + c;
s += ((d.getMinutes()<10)?"0":"") + d.getMinutes() + c;
s += ((d.getSeconds()<10)?"0":"") + d.getSeconds();
return(s);
}
document.write(getTimeString());
//-->
</script>
</body>
</html>
<script type="text/javascript">
<!--
var oDate = new Date();
document.write(oDate.toLocaleString().split(" ")[1]);
//-->
</script>