|
-
Dec 11th, 2001, 10:34 AM
#1
Thread Starter
Fanatic Member
Easy Time Question
I want to display the "connection" time of a client to a server
what is the easiest way to determine the months / days / hours / minutes a client has been connected?
???
ctTime = now - connectedattime
-------------------
WinSock_ConnectionRequesy
connectedattime=now
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Dec 11th, 2001, 11:03 AM
#2
PowerPoster
That would work. Try using the DateDiff function. I think that is the primary purpose, but I've never used it. It should be self explanatory in VB when the menu/tooltip pops up telling you want to do.
-
Dec 11th, 2001, 11:17 AM
#3
Thread Starter
Fanatic Member
thanks, I didn't know about datediff
I got it to spit out the number of seconds... is there an easy way to format seconds to days / hours / min / secs in VB?
(other than dividing by 60 etc.
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Dec 11th, 2001, 11:24 AM
#4
Hyperactive Member
use:
VB Code:
DateDiff("s", StartTime, EndTime)
-
Dec 11th, 2001, 11:27 AM
#5
PowerPoster
Originally posted by kurtsimons
thanks, I didn't know about datediff
I got it to spit out the number of seconds... is there an easy way to format seconds to days / hours / min / secs in VB?
(other than dividing by 60 etc.
I have a function at home that does this, but it does divide by 60, I think. I'll post it for you when I get home if nobody helps you by then.
-
Dec 11th, 2001, 11:31 AM
#6
Thread Starter
Fanatic Member
no thats what I'll do... did now if I could pass that result off to a format() type of a function
thanks
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Dec 11th, 2001, 10:49 PM
#7
PowerPoster
Do you still need that function? I can't seem to find it in my code DB, but I can probably rewrite it for you if you need it. I don't want to write it and then find out that you already know how to do it.
-
Dec 12th, 2001, 12:42 AM
#8
Thread Starter
Fanatic Member
no need, I got it under controll
Kurt Simons
[I know I'm a hack but my clients don't!]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|