ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





ASP Source Code:
<%
Dim DateToCompareTo
' DateToCompareTo = #1/1/2004#
DateToCompareTo = CDate("January 1, " & (Year(Now()) + 1))
If Month(Now()) = 1 And Day(Now()) = 1 Then
	%>
	<p>
	<strong>Happy New Year!!!</strong>
	</p>
	<%
Else
	%>
	<p>
	<strong>Countdown to <%= Year(DateToCompareTo) %>!</strong><br />
	There are <%= DateDiff("m", Now(), DateToCompareTo) %> months left till the year <%= Year(DateToCompareTo) %>!<br />
	There are <%= DateDiff("d", Now(), DateToCompareTo) %> days left till the year <%= Year(DateToCompareTo) %>!<br />
	There are <%= DateDiff("h", Now(), DateToCompareTo) %> hours left till the year <%= Year(DateToCompareTo) %>!<br />
	There are <%= DateDiff("n", Now(), DateToCompareTo) %> minutes left till the year <%= Year(DateToCompareTo) %>!<br />
	There are <%= DateDiff("s", Now(), DateToCompareTo) %> seconds left till the year <%= Year(DateToCompareTo) %>!
	</p>
	<%
End If
%>
<p>
If you are curious it is currently <%= Time() %> on <%= Date() %>.
</p>

Back the the Sample Output

Back to the Sample Index


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers