When you think ASP, think...
logo
spgif
search
spgif
site-index
spgif
Recent Articles xml
All Articles
ASP.NET Articles
ASPFAQs.com
Related Web Technologies
User Tips!
Coding Tips
spgif
spgif spgif
spgif

leftnav-resources
spgif
Sections:
Sample Chapters
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
spgif
spgif spgif
ASP ASP.NET ASP FAQs Feedback topnav-right
right-bg
Print this page.
User Tips: Displaying Date-Specific Content


By Rob B.

Hi there!

Just thought i'd send this in, it's only short but it does the trick. I'm using it to change the logo on my site to the Christmas version automatically, every year!

Here's the code:

Dim Toady Dim Christmas Today = Date() Christmas = "12/25/" & Right(Year(Date()),2) If DateDiff("D", Christmas, Today) > -15 OR DateDiff("D",Today, Christmas) < 15 Then ' INSERT CHRISTMAS CONTENT/SCRIPT HERE Else ' THIS IS SHOWN WHEN IT's NOT BETWEEN - 11/12/** & 09/1/** (These are UK Dates i know :)) End If

Happy Programming!

Return to user tips...


ASP.NET [1.x] [2.0] | ASPFAQs.com | Advertise | Feedback | Author an Article