%@ Language=VBScript %>
<%
CompareDate = #11/24/2001 12:00:00 PM#
CurrentDate = Now
YearDiff = Year(CurrentDate) - Year(CompareDate)
if month(CompareDate) < month(CurrentDate) then
YearDiff = YearDiff -1
end if
If YearDiff = 1 then
TheMessage = "Honeymoon
"
elseif YearDiff > 1 then
TheMessage = YearDiff & " years
"
end if
MonthDiff = Month(CurrentDate) - Month(CompareDate)
if MonthDiff < 0 then
MonthDiff = 12 + MonthDiff
end if
if cdate(month(CurrentDate) & "/" & Day(CompareDate) & "/" & year(CurrentDate)) > CurrentDate then
MonthDiff = MonthDiff - 1
end if
If Day(CurrentDate) >= day(CompareDate) then
DayDiff = Day(CurrentDate) - day(CompareDate)
else
NextMonth = Month(CurrentDate) + 1
If NextMonth = 13 then
NextMonth = 1
MonthDiff = NextMonth
end if
LastDayOfMonth = 30
DayDiff = LastDayOfMonth - day(CompareDate) + Day(CurrentDate)
end if
If MonthDiff = 1 then
TheMessage = TheMessage & "1 month
"
elseif MonthDiff > 1 then
TheMessage = TheMessage & MonthDiff & " months
"
end if
if Hour(CurrentDate) >= Hour(CompareDate) then
DayDiff = DayDiff +1
end if
If DayDiff = 1 then
TheMessage = TheMessage & "1 day
"
elseif DayDiff > 1 then
TheMessage = TheMessage & DayDiff & " days
"
end if
HourDiff = Hour(CurrentDate) - Hour(CompareDate)
if minute(CompareDate) < minute(CurrentDate) then
HourDiff = HourDiff - 1
end if
If HourDiff = 1 then
TheMessage = TheMessage & "1 hour
"
elseif HourDiff > 1 then
TheMessage = TheMessage & HourDiff & " hours
"
end if
MinuteDiff = Minute(CompareDate) - Minute(CurrentDate)
if MinuteDiff < 0 then
MinuteDiff = 60 + MinuteDiff
end if
if second(CompareDate) < second(CurrentDate) then
MinuteDiff = MinuteDiff - 1
end if
If MinuteDiff = 1 then
TheMessage = TheMessage & "1 minute
"
elseif MinuteDiff > 1 then
TheMessage = TheMessage & MinuteDiff & " minutes
"
end if
SecondDiff = Second(CompareDate) - Second(CurrentDate)
if SecondDiff < 0 then
SecondDiff = 60 + SecondDiff
end if
If SecondDiff = 1 then
TheMessage = TheMessage & "1 second
"
elseif SecondDiff > 1 then
TheMessage = TheMessage & SecondDiff & " seconds
"
end if
%>
|
<% Response.Write TheMessage %> Since we got Married! |
|
|