If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Find difference in time?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-29-03, 14:04
carvelo carvelo is offline
Registered User
 
Join Date: Apr 2003
Posts: 1
Arrow 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
Reply With Quote
  #2 (permalink)  
Old 04-30-03, 02:31
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
Re: Find difference in time?

Quote:
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
Reply With Quote
  #3 (permalink)  
Old 05-01-03, 13:29
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On