How to Count number of specific day
-
For example now is tuesday 20/6/2006, how can i do to cout the number of tuesday from 1/1/2006 to now. Help me huhuhu:(( I tried so hard and got so far
-
For example now is tuesday 20/6/2006, how can i do to cout the number of tuesday from 1/1/2006 to now. Help me huhuhu:(( I tried so hard and got so far
Hmmmmmm sounds like another homework assignment. You will not get a your homework done by us, however I can give you a direction to head: Think: DateTime.AddDays() and DateTime.DayOfWeek along with a for loop.
-
For example now is tuesday 20/6/2006, how can i do to cout the number of tuesday from 1/1/2006 to now. Help me huhuhu:(( I tried so hard and got so far
System.DateTime today = System.DateTime.Now; int iDOY = today.DayOfYear(); The above will tell you (in iDOY) what day of the year the current date is (i.e. number between 1 and 366). Tom Delany