Question : How to get first sunday for every month for one year

How to get first sunday for every month for one year in vb.net

Answer : How to get first sunday for every month for one year

Hi SGUDAPAT,

Try this:
1:
2:
3:
4:
5:
6:
7:
8:
9:
        For x As Integer = 1 To 12
            Dim newDate As DateTime = New DateTime(2009, x, 1) 
            While newDate.DayOfWeek <> DayOfWeek.Sunday
                newDate = newDate.AddDays(1)
            End While 
            Debug.WriteLine(newDate.ToLongDateString)
        Next
Random Solutions  
 
programming4us programming4us