I needing a program increase/decrease a day every 5 second or 1 min for clock system

I use date function to set day but I so weak in timer function :) and 1 loop fuction to when it to day 30 it will return 1

8 Years
Discussion Span
Last Post by phuanon

I think you want to increase day in your program only..For this just use your timer control.First set the interval property to 5 [5000 in timer = 5 seconds ] seconds or 1 min.Then use a label or something to display the time and day.
Declare an integer then add it in timer and then set label1.caption = that declared integer.
Here i set a timer and a label named lbl1 and used this code

Dim a As Integer
Dim b As Integer
Dim c As Integer
Private Sub Timer1_Timer()
If a = 60 Then
a = 0
    If b = 24 Then
    b = 0
    c = c + 1
    b = b + 1
    End If
a = a + 1
End If
lbl1.Caption = a & " -Min: " & b & " -Hrs " & c & " -Day "
End Sub

Try it ...
I think this will help you ...


If you want to do anything by using the day you set then just call the "c".It will store the day in c.And you can use to compare , or do some other coding..
Best wishes...

Edited by Vineeth K: There is an error in my netconnection , this post is just duplicated.


thk this i know how to use timer My program change day window system

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.