C# API documentation issues
According to http://msdn2.microsoft.com/en-us/library/system.datetime_methods(VS.71).aspx the AddHours() method for any DateTime instance has the following effect:
AddHours: Adds the specified number of hours to the value of this instance.
This means that given a DateTime object “dt”, and that the method AddHours is called on that object, the specific object instance “dt” will be updated with the new value.
As can be seen above, this is also what is shown in the codecompletion hint text in Microsoft Visual Studio 2005.
So the following code should yield the new date value “2008-04-17 10:03:00″:
DateTime dt = new DateTime(2008, 04, 17); // The object instance "dt" is now equal to "2008-04-17 00:00:00 dt.AddHours(10.0); dt.AddMinutes(3.0); // "dt" is now "2008-04-17 00.00.00" ?!
… but instead it yields the value “2008-04-17 00:00:00″.
Digging further in the API documentation you’ll find a contradiction on the method description pages, eg. http://msdn2.microsoft.com/en-us/library/system.datetime.addhours(VS.71).aspx:
Return Value
A DateTime whose value is the sum of the date and time represented by this instance and the number of hours represented by value.
…
This method does not change the value of this DateTime. Instead, a new DateTime is returned whose value is the result of this operation.
So the correct code is:
DateTime dt = new DateTime(2008, 04, 17); // The object instance "dt" is now equal to "2008-04-17 00:00:00 dt = dt.AddHours(10.0); dt = dt.AddMinutes(3.0); // "dt" is now "2008-04-17 10.03.00"
And that’s not playing nice - now is it? The definition text is ambiguous. Looking closely to the hint text you’ll notice that a DateTime object instance is returned when calling the AddHours method: “DateTime DateTime.AddHours(double value)”.
I suggest correcting the documentation text to the following unambiguous definition:
AddHours: Returns a new DateTime with the specified number of hours added to the value of this instance.

Jeg er nu gået igang med at sætte mig ind i
My current work is really focused on 
