Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how find remaing day between today and onather day in vb.net.
another day give by datetime piker.pls pls help me.tax
Posted

1 solution

If your take any two days as DateTimes (which teh DateTimePicker will give you as the Value property, you can subtract them to give you a TimeSpan.

This has a Days property which will tell you what you need.
VB
Dim d1 As New DateTime(2011, 1, 1)
Dim d2 As New DateTime(2011, 12, 31)
Dim diff As TimeSpan = d2 - d1
Console.WriteLine(diff.Days)
 
Share this answer
 

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