By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,127 Members | 1,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,127 IT Pros & Developers. It's quick & easy.

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

P: n/a
Tim
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)
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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!
Jul 19 '05 #2

P: n/a
Tim
Thanks!! This makes much more cense than what I was trying to do.
Jul 19 '05 #3

P: n/a
Tim
Thanks!! This makes much more cense than what I was trying to do.
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.