Results 1 to 8 of 8

Thread: Easy Time Question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833

    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!]

  2. #2
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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!]

  4. #4
    Hyperactive Member
    Join Date
    Jan 2001
    Posts
    378
    use:

    VB Code:
    1. DateDiff("s", StartTime, EndTime)

  5. #5
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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!]

  7. #7
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    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
  •  



Click Here to Expand Forum to Full Width