Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Posts
    1

    Arrow Unanswered: Find difference in time?

    I'm trying to delete particular data in a table that's over 5 minutes old. I have a 'timecreated' field in the table and need to check that against the current time to see if it should be deleted. I've tried datediff, but I guess that doesn't work in ASP. I'm pretty new, so please help me out if you can. Thanks!

    -Nick

  2. #2
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191

    Re: Find difference in time?

    Originally posted by carvelo
    I'm trying to delete particular data in a table that's over 5 minutes old. I have a 'timecreated' field in the table and need to check that against the current time to see if it should be deleted. I've tried datediff, but I guess that doesn't work in ASP. I'm pretty new, so please help me out if you can. Thanks!

    -Nick
    DateDiff has always worked for me... you must be doing something incorrectly...

    Try this simple little snippet of code to see...

    t1=now()
    str="test"
    for n=1 to 5000000
    str=str+"n"
    If Len(str)>100 then str=""
    next
    t2=now()
    response.write datediff("s",t1,t2)

    It should return a time difference of just a few seconds back to you.

    To get it to work to time minutes, just replace the "s" with "n".

    Hope this helps....

    Tim
    Tim

  3. #3
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •