0
votes

So I just wanna share the answer to my question. So 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 use for due dates or date counter.

1

1 Answers

2
votes
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