Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Objects Methods Documentation

Jericoe States
Jericoe States
3,262 Points

Using the provided link I couldn't determine correct answer?

Was I expected the read that whole link? its a lot of informatics to read through just to see whether the statement is static or not. Or maybe I just don't know where to look?

Is there an easier way to find the information I need or reading the full article is a must?

3 Answers

If you do a Find on AddDays it takes you to an entry under Methods with the following description

Returns a new DateTime that adds the specified number of days to the value of this instance.

If that is not enough information click on the AddDays link and see

public DateTime AddDays (double value);

and how it is used in the example

DateTime today = DateTime.Now;
DateTime answer = today.AddDays(36);

This indicates that AddDays() is an instance method.

Compare this to DaysInMonth

public static int DaysInMonth (int year, int month);

and how it is used in the example

int daysInJuly = System.DateTime.DaysInMonth(2001, July);

which indicates that DaysInMonth is a static method

Which question? Also you can use Find in your browser to quickly locate the method.

Jericoe States
Jericoe States
3,262 Points

The AddDays() method in System.DateTime is ____. Use the documentation available at

https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx to determine the correct answer.

There is a lot of information on that link! resembles wikipedia and its 10x as confusing. like what do I look at first?