When I'm writing the following code, the values don't match even if the current system DateTime is equal to the variable. Label1 isn't showing 'Times Matched':
Expand|Select|Wrap|Line Numbers
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Dim dtmNow As DateTime
- dim dtmVar as DateTime=#04/28/2010 03:25:00 AM#
- dtmNow = Now
- If dtmVar = dtmNow Then Label1.Text = "Times Matched"
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Dim dtmNow As DateTime
- dim dtmVar as DateTime=#04/28/2010 03:25:00 AM#
- dtmNow = DateTime.Parse(Now.ToString)
- If dtmVar = dtmNow Then Label1.Text = "Times Matched"
- End Sub
Provided, my O.S. is Windows Vista Ultimate and all date/time settings are set to default.
Regards.