Home All Groups Group Topic Archive Search About

how to find specific date?

Author
29 Sep 2006 2:53 PM
ibiza
Hi all,

I need to find a specific, for example the third friday of a given
month/year. How to do that?

thanks :)

Author
29 Sep 2006 5:57 PM
Josip Medved
It should be something like this

Dim myDate as new date(year,month,1)
Do While myDate.DayOfWeek <> Friday
  myDate = myDate.AddDay(1)
Loop

myDate = myDate.AddWeeks(2)

That should give you third friday of given year/month.


--
Greetings,
  Josip Medved
  http://www.jmedved.com


ibiza wrote:
Show quoteHide quote
> Hi all,
>
> I need to find a specific, for example the third friday of a given
> month/year. How to do that?
>
> thanks :)