Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 17th, 2003, 09:17 AM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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????

Reply With Quote
  #2  
Old August 17th, 2003, 09:23 AM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old August 17th, 2003, 09:50 AM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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....

Reply With Quote
  #4  
Old August 17th, 2003, 09:58 AM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
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.

Reply With Quote
  #5  
Old August 17th, 2003, 10:00 AM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How to do program "up time"??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway