Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

Getting the wrong number of days for days between dates

$
0
0
I am trying to write a function to get the "Days between dates". The code I have (for a console application) is shown below. For some reason, it is not giving the correct number of days between dates. How do I get this to work correctly?
Code:
Dim BeginningDate As Date
Dim EndingDate As Date

Dim DaysBetweenDates = DateDiff(DateInterval.Day, EndingDate.Date, BeginningDate.Date)
Dim msg = String.Format(" days between dates.", DaysBetweenDates)

Console.WriteLine("...
Getting the wrong number of days for days between dates

Viewing all articles
Browse latest Browse all 1987

Trending Articles