Click here to Skip to main content
15,904,348 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
my datetimepicker1 = March 5, 2012 and datetimepicker2 = March 8, 2012 and how to obtain 3???

numberofDays=3;
Posted

1 solution

Hi,

Have a look into DateTime.Subtract:

http://msdn.microsoft.com/de-de/library/8ysw4sby.aspx[^]

[EDIT — SA]

Why would OP, who is from Philippines, use your German version, if the question was in English? I would suggest this:

http://msdn.microsoft.com/library/8ysw4sby.aspx[^].

Also, it's good to know that using the method through subtraction operator "-" is way more readable and clear.

[END EDIT]

Regards
 
Share this answer
 
v2
Comments
ProEnggSoft 3-Mar-12 22:23pm    
My 5!
Sergey Alexandrovich Kryukov 3-Mar-12 23:16pm    
If you don't mind, I added a fix and a note right in your text.
--SA
El_Codero 4-Mar-12 7:57am    
Oh excuse me, didn't realized early enough that I've copied the german link. Regards

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900