- Home /
How do you list all the days of the current month?
I'm trying to get all the dates of the current month for a calendar game I'm working on. I know how to get the first day of the month already but I'm having trouble figuring out how to get the rest of the dates for c#. Can anyone help me with this please?
Comment
Best Answer
Answer by Landern · Sep 09, 2014 at 08:49 AM
If you know the month/year, use:
int numOfDays = DateTime.DaysInMonth(2014, 9);
That will give you the amount of days, 30 in this case. After that constructing each day is just a loop.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
ExpManagement problems 1 Answer
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Formatting Calendar, Iterating through list of strings. 1 Answer