0103media Site Admin
Joined: 17 Feb 2005 Posts: 21
|
Posted: Wed Aug 31, 2005 11:40 am Post subject: ASP check date - month year day etc.. |
|
|
Oky I always forget this...
Just spent 5 mins trying to find the correct syntax for a if statment that check the date... So simple...
| Code: | | <%If Month(date) = 9 And Year(Date) = 2005 Then%> |
The above IF statement will show whatever is with the IF on the 9 month in the 2005 year..
Note that the time is taken from the server so remeber to check the server time as the time differences will have big impacts on when the statement work and doesn't work..
You add add a day as below.. The check asp with day month and year.
| Code: | | <%If Day(date)=1 And Month(date) = 9 And Year(Date) = 2005 Then%> |
By removing the year and the month to the above code your can show something every month..
| Code: | | <%If Day(date) = 1 Then%> |
The above will show whatever you want on the first of every month..
Hope this helps.. |
|