Windows Develop Bookmark and Share   
 index > Windows Forms Designer > addition date
 

addition date

I am using VB.NET windows forms.
I have problem with addition(+) between startdate and enddate
I want to show value to total how many day
example
startdate =#01/01/2003#
enddate =#02/05/2003#
totaldate = startdate+enddate
what is sum value totaldate?
Can any one help?
Thanks
MigrationUser 1  Saturday, March 01, 2003 11:07 PM
Adding Dates together Yields no definable results, even in real life.

What you probably want is a DateTime span, which is the amount of "Time" that lies between the startdate and the enddate.

This is done by substracting 2 dates together.
it should also be expressed as totaldays (or totaltime) etc

totaldays = enddate - startdate

Now, once you have a timespan, you can use is to add or substract from other dates. etc etc.

Hope this helps you.
MigrationUser 1  Monday, March 03, 2003 7:50 PM
Not accounting for leapyears but it would be March 6th, 4006 ;)
MigrationUser 1  Friday, March 07, 2003 1:24 PM

You can use google to search for other answers

Custom Search

More Threads

• Insufficient memory to continue the execution of the program.
• trap keypress event for datagridview while editing
• VS Crashes upon exit
• Mouse wheel and scroll bar
• recommend books 4 developing custom control
• Add controls by code in designersurface host?
• Replace cell of propertygrid with custum Textbox
• layout components when resizing
• Urgent for Tabindex in UserControl
• Inheriting form class: making MustInherit?