To read the article online, visit http://www.4GuysFromRolla.com/webtech/tips/t112999-2.shtml

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...


Article Information
Article Title: User Tips: Displaying Date-Specific Content
Article Author: Rob B.
Article URL: http://www.4GuysFromRolla.com/webtech/tips/t112999-2.shtml


Copyright 2017 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers