How long is the calculation from the age of 22 [for friends under 22 years of age]_hta

Source: Internet
Author: User
Hehe is not very accurate, understand friends do not laugh at me. Although I want to do very accurate, but the algorithm is too cumbersome, so use a simple and convenient.
Copy Code code as follows:

<script language= "JavaScript" >
/*
Screen.availwidth = Screen Work area width
Screen.availheight = high screen work area
*/
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 = "Xiao Cai"
Ubirthday = #1981-01-25 00:00:00#
Usex = 1 ' "' 0 = female 1 = male" "
Lage = Array (20,22)
Ldate = DATEADD ("yyyy", Lage (Usex), Ubirthday)
</script>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<meta http-equiv=content-type content= "text/html; charset=gb2312 ">
<title> Marriage </title>
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: "The song Body";
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 &" Minutes "& Dsecond &A mp Seconds
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 & "Year" & Dmonth & "Month" & DDay & "Day"
' document.getElementById ("MyDIV1"). Innerhtml= "<font color=red>" & UName & "</font> according to legal age of marriage < Font color=blue> "& Lage (usex) &" </font> years old "
End Function
</script>
<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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.