DateAdd Function in VB.NET

How to use DateAdd Function?


DateAdd Function

DateAdd Function in Visual 2008 is used to returns a date with a date,time value added with a specified time intreval.

DateAdd(interval, number, date)

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs)Handles MyBase.Load
MsgBox("10 Days after the current date is::"
& DateAdd(DateInterval.Day, 10, Now))
End Sub
End Class

In the above DateAdd Function example, a date is added after an intreval of 10 days to the current date value.

Visual Basic Tutorial

Ask Questions

Ask Question