|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
How to do program "up time"??
Hi all...
i sort of managed to let the program tell the user how long has it been runnning... BUT, i need it to be more accurate down to years, months, days too.... currently... i can only do the time... here it goes:... ** note StartUpTIme is a global variable declared as date.. Private Sub Form_Load() 'Start to count server online time StartUpTime = Now() End Sub Private Sub CommandUpTime_Click() dim uptime as date uptime= "Server has been up for" _ & ", " & Format(Hour(Now() - StartUpTime), "0") & " Hours" _ & ", " & Format(Minute(Now() - StartUpTime), "0") & " Minutes" _ & ", " & Format(Second(Now() - StartUpTime), "00") & " Seconds" msgbox uptime End Sub can some one help me???? |
|
#2
|
|||
|
|||
|
you'd have to keep a running total of all time running. when they close the program you'd have to save that amount of time. probably best to store it as the number of seconds that way you can easily figure out years and days.
__________________
Programmer's Corner |
|
#3
|
|||
|
|||
|
i dont need to keep (save) the time when they quit..
i just want to know how to track the "up-time" of the program when it is active.... |
|
#4
|
|||
|
|||
|
you expect the up-time to go for years? you'll probably want to look into the DateDiff function.
also the code for your command click is off. you declare a date variable and then store a string in it. |
|
#5
|
|||
|
|||
|
????
no no no.....
i dont expect it to go to years... ;p just days will do.. (i expect)..... and about your string into a date format... i dont quite get it.... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > How to do program "up time"?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|