ycomp Posted April 26, 2008 Posted April 26, 2008 I need to determine if a specific day has passed already this year. e.g. Last Sunday in March How can I do that? Here are some more of examples of what I want to evaluate: Last Sunday in March Last Sunday in October First Sunday in April second Sunday in March first Sunday in November
monoceres Posted April 26, 2008 Posted April 26, 2008 (edited) Here's me idea, although I think there is a more clever way: #include <date.au3> $daytocheck=05 ; Friday $count=0 For $i=1 To @mday If _DateToDayOfWeekIso(@year,@mon,$i)=$daytocheck-1 Then $count+=1 EndIf Next MsgBox(0,"Result:","There has been "&$count&" fridays this month") Edit: So if you want to check againt it, just do: If $count>=1 Then ; First friday of current month has passed Edited April 26, 2008 by monoceres Broken link? PM me and I'll send you the file!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now