Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- detect system date change, visual basics
- Dim today As Integer
- today = Format(Now, "dd")
- Dim iMinute As Integer 'The "current" minute
- Private Sub Form_Load()
- 'Initialize
- iMinute = Format(Now, "n") 'Get the current time as minute
- Timer1.Interval = 1000 'Set interval = 1000 milliseconds
- Timer1.Enabled = True 'Start Timer1 (my Timer)
- End Sub
- Private Sub Timer1_Timer()
- 'This happens when the given Interval has passed (in this case, every second)
- Dim iMinuteNow As Integer
- iMinuteNow = Format(Now, "n")
- If iMinuteNow <> iMinute Then
- MsgBox "You are now in a new minute"
- iMinute = iMinuteNow
- End If
- End Sub
Add Comment
Please, Sign In to add comment