Reputation: 141
I just want to share the answer to my question. This is the code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim NextTime As Date = Now
TextBox1.Text = NextTime.AddDays("set a count here".0) ' for example (100.0)
End Sub
This can be used for due dates or date counter.
Upvotes: 0
Views: 2052
Reputation: 877
Dim newDate As DateTime = DateTime.Parse(Label1.Text).AddMonths(6)
Duedate.text = newDate.ToString
You need to make sure the format is correct though, this can be done with the following bit of code:
Dim pattern As String = "MM-dd-yy"
Dim parsedDate As Date
If DateTime.TryParseExact(Label1.Text, pattern, Nothing,
DateTimeStyles.None, parsedDate) Then
Console.WriteLine("We're good!)
Else
Console.WriteLine("Unable to convert")
End If
Upvotes: 2