Changes

Jump to: navigation, search

Working with Dates and Times in Visual Basic

7 bytes added, 19:38, 2 August 2007
Finding the Interval Between Two Dates or Times
The difference between to dates or times can be determined using the Visual Basic ''DateDiff()'' function, the syntax for which is:
'''DateDiff(''' ''interval'', ''Date1'', ''Date2'' ''')'''
The ''interval'' parameter specifies the unit of time to use when measuring the difference between two date and using the same values as those outlined for the ''DateAdd()'' function covered previously in this chapter. The two date values the represent the dates to compared. The function returns the difference as the number of specified units. For example, if the interval is defined as ''DateInterval.Day'' and the two dates are a week apart, ''DateDiff()'' will return 7.

Navigation menu