<html>
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date()
var d=23-today.getDate()
var h=11-today.getHours()
var m=5-today.getMinutes()
var s=60-today.getSeconds()
// add a zero in front of numbers<10
m=checkTime(m)
s=checkTime(s)
if(d=="0"&&h=="0"&&m=="00"&&s=="01"){
document.getElementById('txt').innerHTML=0+"天"+00+":"+00+":"+00
return false;
}
document.getElementById('txt').innerHTML=d+"天"+h+":"+m+":"+s
t=setTimeout('startTime()',1000)
}
function checkTime(i)
{
if (i<10)
{i="0" + i}
return i
}
</script>
</head>
<body onload="startTime()">
<div id="txt"></div>
</body>
</html>
-----------------------------------
form 的textrear
et:最多输入1000个字符@@charmax:1000
--------------------------------------------
js的所有日期方法
var y=today.getFullYear()--获取年
getDate-Returns the day of the month for the specified date. --获取日期
getDay -Returns the day of the week for the specified date.
getHours -Returns the hour in the specified date. --获取小时
getMinutes -Returns the minutes in the specified date. --获取分钟
getMonth -Returns the month in the specified date. --获取月份(用的时候+1)
组成字符串的时候可以用获取的年与日拼接就好
getSeconds -Returns the seconds in the specified date.
getTime -Returns the numeric value corresponding to the time for the specified date.
getTimezoneOffset -Returns the time-zone offset in minutes for the current locale.
getYear -Returns the year in the specified date.
parse -Returns the number of milliseconds in a date string since January 1, 1970, 00:00:00, local time.
setDate -Sets the day of the month for a specified date.
setHours -Sets the hours for a specified date.
setMinutes -Sets the minutes for a specified date.
setMonth -Sets the month for a specified date.
setSeconds -Sets the seconds for a specified date.
setTime -Sets the value of a Date object.
setYear -Sets the year for a specified date.
toGMTString -Converts a date to a string, using the Internet GMT conventions.
toLocaleString -Converts a date to a string, using the current locale's conventions.
UTC -Returns the number of milliseconds in a Date object since January 1, 1970, 00:00:00, Universal Coordinated Time (GMT).
<head>
<script type="text/javascript">
function startTime()
{
var today=new Date()
var d=23-today.getDate()
var h=11-today.getHours()
var m=5-today.getMinutes()
var s=60-today.getSeconds()
// add a zero in front of numbers<10
m=checkTime(m)
s=checkTime(s)
if(d=="0"&&h=="0"&&m=="00"&&s=="01"){
document.getElementById('txt').innerHTML=0+"天"+00+":"+00+":"+00
return false;
}
document.getElementById('txt').innerHTML=d+"天"+h+":"+m+":"+s
t=setTimeout('startTime()',1000)
}
function checkTime(i)
{
if (i<10)
{i="0" + i}
return i
}
</script>
</head>
<body onload="startTime()">
<div id="txt"></div>
</body>
</html>
-----------------------------------
form 的textrear
et:最多输入1000个字符@@charmax:1000
--------------------------------------------
js的所有日期方法
var y=today.getFullYear()--获取年
getDate-Returns the day of the month for the specified date. --获取日期
getDay -Returns the day of the week for the specified date.
getHours -Returns the hour in the specified date. --获取小时
getMinutes -Returns the minutes in the specified date. --获取分钟
getMonth -Returns the month in the specified date. --获取月份(用的时候+1)
组成字符串的时候可以用获取的年与日拼接就好
getSeconds -Returns the seconds in the specified date.
getTime -Returns the numeric value corresponding to the time for the specified date.
getTimezoneOffset -Returns the time-zone offset in minutes for the current locale.
getYear -Returns the year in the specified date.
parse -Returns the number of milliseconds in a date string since January 1, 1970, 00:00:00, local time.
setDate -Sets the day of the month for a specified date.
setHours -Sets the hours for a specified date.
setMinutes -Sets the minutes for a specified date.
setMonth -Sets the month for a specified date.
setSeconds -Sets the seconds for a specified date.
setTime -Sets the value of a Date object.
setYear -Sets the year for a specified date.
toGMTString -Converts a date to a string, using the Internet GMT conventions.
toLocaleString -Converts a date to a string, using the current locale's conventions.
UTC -Returns the number of milliseconds in a Date object since January 1, 1970, 00:00:00, Universal Coordinated Time (GMT).