<%dim dayMSEL,dayNum,eightHourMSEL,LostMSEL,BeginPrice,EndPrice,BeginDayNum,EndDayNum,beginMSEL,EndMSEL,hourMSEL,MinuteMSEL
dayMSEL=1000*60*60*24'一天的毫秒数
hourMSEL=1000*60*60'一小时的毫秒数
MinuteMSEL=1000*60'一分钟毫秒数
eightHourMSEL=1000*60*60*8'格林威治标准时间(GMT)比北京时间晚8个小时,所以减去8个小时的毫秒
BeginDayNum=datediff("d","1970-1-1",rs("aucAvailDate"))'该时间从1970-1-1开始,所以计算该时间到开始有多少天
EndDayNum=datediff("d","1970-1-1",rs("aucCloseDate"))'该时间从1970-1-1开始,所以计算该时间到结束有多少天
LostMSEL=hour(rs("aucAvailDate"))*hourMSEL+Minute(rs("aucAvailDate"))*MinuteMSEL+Second(rs("aucAvailDate"))*1000'午夜 12 时以后已经过去的毫秒数。
beginMSEL=BeginDayNum*dayMSEL+LostMSEL-eightHourMSEL
EndMSEL=EndDayNum*dayMSEL+LostMSEL-eightHourMSEL
BeginPrice=rs("aucStartingBid")
EndPrice=rs("aucReservePrice")%>
自动递减或递增的JS变化
---------------------------------------------------------------------------------------------------------------------------------------------
<SCRIPT type=text/javascript>
<!--
function el(id) {
if (document.getElementById) {
return document.getElementById(id);
} else if (window[id]) {
return window[id];
}
return null;
}
var CP = [
[ 1136102400000, 2680 ],//1136102400000表示1970-7-1年到该日的所有毫秒数
[ 1149145200000, 2730 ],
[ 1167638400000, 2800 ]
];
var quota;
function updateQuota() {
if (!quota) {
return;
}
var now = (new Date()).getTime();
var i;
for (i = 0; i < CP.length; i++) {
if (now < CP[i][0]) {
break;
}
}
if (i == 0) {
setTimeout(updateQuota, 1000);
} else if (i == CP.length) {
quota.innerHTML = CP[i - 1][1];
} else {
var ts = CP[i - 1][0];
var bs = CP[i - 1][1];
quota.innerHTML = format(((now-ts) / (CP[i][0]-ts) * (CP[i][1]-bs)) + bs);
setTimeout(updateQuota, 1000);
}
}
var PAD = '.000000';
function format(num) {
var str = String(num);
var dot = str.indexOf('.');
//alert (dot);
if (dot < 0) {
return str + PAD;
} if (PAD.length > (str.length - dot)) {
return str + PAD.substring(str.length - dot);
} else {
return str.substring(0, dot + PAD.length);
}
}
// -->
</SCRIPT>
超过 <SPAN id=quota>2000</SPAN>
MB(还在增加中)
<SCRIPT>
<!--
quota = el("quota");
updateQuota();
// -->
</SCRIPT>