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!