Fri Apr 08, 2011 9:36 pm
Function testYear(ByVal inputDate, ByVal testDate, ByVal strDifference)
Here we test using years (yyyy) , difference in years .
strDifference = DateDiff("yyyy", testDate, inputDate)
If strDifference < 18 Then
Response.Write("Sorry you must be older than 18 years")
Else
Response.Write("Welcome ,you can enter this site.")
End If
End Function
Function diffDays(ByVal inputDate, ByVal testDate, ByVal strDifference)
'Here we test using years (yyyy)
testDate = "11/12/2001"
'here we show difference in days.
strDifference = DateDiff("d", testDate, inputDate)
print the difference in page.
Response.Write(strDifference & " to date " & testDate)
End Function
<%
Dim dateToday, dateAfterAdd
dateToday = Date.Now
Response.Write("current date is " & dateToday & "<br>")
add 6 years to a date .
dateAfterAdd = DateAdd("yyyy", 6, dateToday)
Response.Write("After adding 6 Years<b> " & dateAfterAdd & "</b><br>")
%>
Dim d_mydate
d_mydate=Now
Get the month part of my date .
Response.Write DatePart("m",d_mydate)
currDate=Now
Response.Write "Date Formatted : "FormatDateTime(currDate,0)
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.