donkeyg Posted July 15, 2012 Posted July 15, 2012 if(gettime(4) != 0 && gettime(4) != 6) end; <<< this is for saturday and sundayhow do i set this time to monday, webnesday and friday only? Quote
Kisuka Posted July 15, 2012 Posted July 15, 2012 // If Monday, Wednesday, or Friday perform an action. if(gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) { // Do Whatever } *gettime(<type>) This function will return specified information about the current system time. 1 = Seconds (of a minute) 2 = Minutes (of an hour) 3 = Hour (of a day) 4 = Day of the Week (0 = Sun, 1 = Mon, 2 = Tues, 3 = Wed, 4 = Thurs, 5 = Fri, 6 = Sat) 5 = Day of the month. 6 = Number of the month. 7 = Year. 8 = Day of the year. The example code I gave does the following: - gettime(4) returns the current day of the week as a digit between 0 (Sun) and 6 (Sat). - Using the if statement with || ("or"), I checked to see if the returned digit was either 1 (Mon), 3 (Wed), or 5 (Fri). - If the returned digit was 1, 3, or 5 it will then perform the task. Quote
donkeyg Posted July 15, 2012 Author Posted July 15, 2012 // If Monday, Wednesday, or Friday perform an action. if(gettime(4) == 1 || gettime(4) == 3 || gettime(4) == 5) { // Do Whatever } *gettime(<type>) This function will return specified information about the current system time. 1 = Seconds (of a minute) 2 = Minutes (of an hour) 3 = Hour (of a day) 4 = Day of the Week (0 = Sun, 1 = Mon, 2 = Tues, 3 = Wed, 4 = Thurs, 5 = Fri, 6 = Sat) 5 = Day of the month. 6 = Number of the month. 7 = Year. 8 = Day of the year. The example code I gave does the following: - gettime(4) returns the current day of the week as a digit between 0 (Sun) and 6 (Sat). - Using the if statement with || ("or"), I checked to see if the returned digit was either 1 (Mon), 3 (Wed), or 5 (Fri). - If the returned digit was 1, 3, or 5 it will then perform the task. how if i make it 1 week have 3 days the event is open for everyone Quote
Kisuka Posted July 15, 2012 Posted July 15, 2012 how if i make it 1 week have 3 days the event is open for everyone Not entirely sure what you mean... can you re-phrase the question please? The script I posted should perform whatever code you put in it every Monday, Wednesday, & Friday on every week. Quote
donkeyg Posted July 15, 2012 Author Posted July 15, 2012 sorry my fault, didnt see clearly, thank you! Quote
Question
donkeyg
how do i set this time to monday, webnesday and friday only?
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.