Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Cam
    Cam is offline
    New Coder
    Join Date
    Jul 2002
    Location
    Toronto ON Canada
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Returning date of recurring day of week

    I've been tossing around trying to figure out if this is possible: what I'd like to do is return the date of the first Friday of every month. The context is a recurring meeting and I'd like to post the date of the next meeting on an intranet site. Currently I just retrieve it from a database, which I may stick with, but I was wondering if this is possible.

    Cheers

    Cam

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    Code:
    'arrWeek = Array("", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
    
    datStartThisMonth = "1/" & Month(Date()) & "/" & Year(Date())
    
    For i = -1 To 11
    	For j = 1 to 7
    		datFirstOfMonth = j & "/" & ((Month(datStartThisMonth)+i) Mod 12)+1 & "/"  & Year(datStartThisMonth) + Int(i/12)+1
    		If WeekDay(datFirstOfMonth) = 6 Then Response.Write datFirstOfMonth & "<br>"
    	Next
    	Response.Write "<hr>"
    Next
    Last edited by ghell; 12-07-2004 at 05:17 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •