In VB, you can use the DateAdd(Interval, value,date) function of DateAndTime module to add a specify time interval to date.
-Interval can be DateInterval.Date (4), DateInterval.DateOfYear (3), DateInterval.Hour (7), DateInterval.Minute (8), DateInterval.Month (2), DateInterval.Quater (1), DateInterval.Second (9), DateInterval.Weekday (6), DateInterval. WeekOfYear (5), DateInterval.Year (0).
-value is the number that indicates the time interval to be added to the date
-date is the date value that the time interval will be added to.
For example, if you want to add 10 days (time interval) to the current date, the value of interval that you will have to specify is DateInterval.Day or 4.
Dim dt = DateAdd(DateInterval.Day, 10, Now)
Console.WriteLine("The date calculated 10 days from now is: " + dt)
Posted by: Ly | post date: 02-18-2013 | Subject: VB.NET Programming Language
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: