When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sections:
Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
ASP ASP.NET ASP FAQs Message Board Feedback
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] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article