离22周岁距离多长时间的计算[适合没到22周岁的朋友]

所属分类: 脚本专栏 / hta 阅读数: 1447
收藏 0 赞 0 分享
嘿嘿不是很精确,懂的朋友就不要笑话本人了。虽然我想做的很精确,但算法太过繁琐,所以就用个简单省事的了。
复制代码 代码如下:

<script language="JavaScript">
/*
screen.availWidth = 屏幕工作区宽
screen.availHeight = 屏幕工作区高
*/
var wWidth = screen.availWidth-(screen.availWidth-370+78)-100;
var wHeight = 20;
var wLeft = screen.availWidth-370+78;
var wTop = 0;
window.moveTo(wLeft,wTop);
window.resizeTo(wWidth,wHeight);
</script>
<script language="VBScript">
uName = "小蔡"
uBirthDay = #1981-01-25 00:00:00#
uSex = 1 ''''' 0=女 1=男 '''''
lAge = Array(20,22)
lDate = dateadd("yyyy",lAge(uSex),uBirthDay)
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<title>结婚</title>
<HTA:APPLICATION
ID="HTA_Pro_Marriage"
APPLICATIONNAME="Pro_Marriage"
BORDER="none"
CAPTION="no"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
showintaskbar="no"
>

<style>
body {
margin: 0px;
}
body,td,div {
font-family: "宋体";
font-size: 14px;
}
img, table, td, div {
border: 0px;
}
</style>
<script language="VBScript">
dim sDate,nDay,nMonth,nYear,nSecond,nMinute,nHour
function ShowTime()
nDay = Day(now())
nHour = Hour(now())
nMinute = Minute(now())
nSecond = Second(now())
dHour = Hour(lDate) - nHour
dMinute = Minute(lDate) - nMinute
dSecond = Second(lDate) - nSecond
if dSecond < 0 then
dMinute = dMinute - 1
dSecond = dSecond + 60
end if
if dMinute < 0 then
dHour = dHour -1
dMinute = dMinute + 60
end if
if dHour < 0 then
nDay = nDay -1
dHour = dHour + 24
end if
if dSecond = 0 then
call ShowDate()
end if
document.getElementById("MyDIV2").innerHTML=sDate & " " & dHour & "时" & dMinute & "分" & dSecond & "秒"
setTimeout "ShowTime()",1*1000
end function
function ShowDate()
nYear = Year(now())
nMonth = Month(now())
dYear = Year(lDate) - nYear
dMonth = Month(lDate) - nMonth
dDay = Day(lDate) - nDay
if dDay < 0 then
dMonth = dMonth -1
dDay = dDay + 30
end if
if dMonth < 0 then
dYear = dYear -1
dMonth = dMonth + 12
end if
sDate = dYear & "年" & dMonth & "月" & dDay & "日"
'document.getElementById("MyDIV1").innerHTML="<font color=red>" & uName & "</font> 据法定结婚年龄<font color=blue>" & lAge(uSex) & "</font>周岁"
end function
</script>
</head>
<body onload="ShowTime();ShowDate();">
<div id="MyDIV1" style="padding-left:3px;padding-top:2px;"></div>
<div id="MyDIV2" style="padding-left:7px;padding-bottom:2px;"></div>
</body>
</html>
更多精彩内容其他人还在看

hta查看磁盘空间的脚本

用hta实现的可以查看磁盘剩余空间的脚本
收藏 0 赞 0 分享

HTA编辑HOST文件的脚本

一个修改HOST文件的小工具,利用FSO实现,代码比较长,功能也比较多
收藏 0 赞 0 分享

hta实现的定时重启或关闭计算机的小工具

一个用于定时重启或关闭计算机的小工具,适用于Windows 2K/XP/2003
收藏 0 赞 0 分享

hta实现的二进制文件转换为文本

hta 二进制文件转换为文本工具
收藏 0 赞 0 分享

风讯注入exp(hta版)代码发布

风讯注入exp实例代码,hta版的方便使用
收藏 0 赞 0 分享

学习正则帮手笨狼正则练习器

把下面的文件保存为hta文件,运行即可
收藏 0 赞 0 分享

hta实现的笨狼XSLT练习器

学习XSLT的朋友,用这个小工具不错
收藏 0 赞 0 分享

hta实现的笨狼树状节点查看器

笨狼树状节点查看器
收藏 0 赞 0 分享

hta作品笨狼CSDN爬虫

笨狼CSDN爬虫
收藏 0 赞 0 分享

hta(vbs)列目录树代码

一个网友在短消息里问我这个问题,并给出了他写的出错代码。短消息有字数限制,在此回复他一下。玩了两个月,没有写代码了,脑子不好用了。费了好大劲,最后还是请教了老马才把网友的代码更写出来,几乎是重写了,呵呵。
收藏 0 赞 0 分享
查看更多