web design forum Forum Index web design forum
Design Web Page HTML Free Web Design Web Designers Learn HTML Web Design Tips Free Web Design Software HTML Help Web Development HTML Guide forum uk
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ASP check date - month year day etc..

 
Post new topic   Reply to topic    web design forum Forum Index -> ASP help
View previous topic :: View next topic  
Author Message
0103media
Site Admin


Joined: 17 Feb 2005
Posts: 21

PostPosted: Wed Aug 31, 2005 11:40 am    Post subject: ASP check date - month year day etc.. Reply with quote

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..
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    web design forum Forum Index -> ASP help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group