Tutorials to .com

Tutorials to .com » Asp » Encoding » Calculated on the date of issue of

Calculated on the date of issue of

Print View , by: iSee ,Total views: 5 ,Word Count: 440 ,Date: Thu, 4 Jun 2009 Time: 8:27 AM

Calculated on the date when the issue is resolved, a lot of friends have found the same problem
Do not know if you have not solved, I posted my method, I hope we can help
Where to write if the bad, or wrong, do not joke! !
But the first time I have to express their ideas, the struggle was very intense. . .
===============================
In order to understand everyone, and the preparation of vbscript =
To understand, what all good writing :)_______=
===============================

<script language=vbscript>
function CountDate (That, NowDate)

Break off both ends''calculated using two dates of the time interval
''Date date date difference between the time difference calculation of the date of
''nowdate is the current date, that is a particular date
On''nowdate minus the total number of days in that month's total number of days (there may be negative)
In addition,''the middle of the total annual number of days, that is, the interval between the date of the
''Run through a leap year calculations on the more precise the.
'=========================
'=idea iamws@371.net =
'=========================

days = 0 'Initialize the number of days

for i = 1 to month (nowdate) -1 'with the increase in the number of days the month
select case i
case 1,3,5,7,8,10,12 'still remember the first year of primary school mathematics it? I write back, ha ha ~ ~
days = days +31'1, 2,5,7,8,10, Prince, there are 31 days
case 4,6,9,11
days = days +30
case 2
if year (that) / 4 = int (year (that) / 4) then days = days +29 else days = days +28
end select
next


for i = year (that) to year (nowdate) -1 'as the year of increase in the number of days
if year (that) / 4 = int (year (that) / 4) then
days = days + 366
else
days = days + 365
end if
next


for i = 1 to month (that) -1 'minus the original
select case i
case 1,3,5,7,8,10,12
days = days-31
case 4,6,9,11
days = days-30
case 2 'run on to deal with
if year (that) / 4 = int (year (that) / 4) then days = days-29 else days = days-28
end select
next


days = days + day (nowdate)-day (that) 'the rate of increase, the reduction by!


CountDate = days

end function
msgbox countdate ( "10/2/00 11:33:25 PM", now)
</ script>


======================================
If you have to help, please give me a simple points, Thank you, thank you! =
======================================


Asp Script encoding Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.