Help! I am having problems with calculating the total seconds from two date/times.

Discussion in 'ASP General' started by Tim, Aug 4, 2003.

  1. Tim

    Tim Guest

    I need to get the number of seconds when subtracting two date/times.
    With the code I am using below I subtract the two date/times and end
    up with a total of days like "1.56". Then when I multiply it to get
    the number of seconds I am not getting an accurate number. I should
    only have whole numbers of seconds with nothing past the decimal
    point. I would like to be able to subtract the two date/times and get
    the number of seconds without multiplying to get it. Is this possible?
    Does anyone have a better more accurate way to do this?

    (Below the value of TTClose will be the number of seconds between the
    two date/time stamps.)

    SQL = "Select * From Table1 WHERE TrackNumber = '" &
    Request.QueryString("MSGNUM") & "'"
    Set RS = Conn.Execute (SQL)
    DetectionTime=RS("DetectionTime")
    RS.Close

    MyTime=Now()

    TClose=(MyTime)-(DetectionTime)
    TTClose=(((TClose*24)*60)*60)
    Tim, Aug 4, 2003
    #1
    1. Advertising

  2. Tim

    Bullschmidt Guest

    DateDiff("S", MyDateTime1, MyDateTime2)

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    http://www.Bullschmidt.com
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt, Aug 5, 2003
    #2
    1. Advertising

  3. Tim

    Tim Guest

    Thanks!! This makes much more cense than what I was trying to do.
    Tim, Aug 5, 2003
    #3
  4. Tim

    Tim Guest

    Thanks!! This makes much more cense than what I was trying to do.
    Tim, Aug 5, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Asad
    Replies:
    2
    Views:
    443
    Matt Berther
    Apr 27, 2004
  2. tshad
    Replies:
    7
    Views:
    16,966
    tshad
    Mar 11, 2005
  3. T-Narg
    Replies:
    3
    Views:
    861
    T-Narg
    Mar 3, 2005
  4. cyril
    Replies:
    4
    Views:
    1,645
    cyril
    Aug 25, 2003
  5. Michael Tan
    Replies:
    32
    Views:
    964
    Ara.T.Howard
    Jul 21, 2005
Loading...

Share This Page