Results 1 to 3 of 3

Thread: Comparing times in ASP

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    New Orleans, LA
    Posts
    37
    how would you (in vbscript) compare times like this:



    if (time1 - time2) > 60minutes then

    code code code code code code code

    end if

    so basically i want to do something only if the 2 times are less then 1 hour apart.

    thanks in advance for any help.

  2. #2
    Guest
    You could use the DateDiff() function with a minutes ("n") interval like so:

    Code:
    If DateDiff("n", datetime1, datetime2) < 60 Then
      '  Do your code here.
    End if
    Paul

    PS - Edited to change 'minuetes' to 'minutes' - geez. :P

    [Edited by PWNettle on 12-12-2000 at 06:08 PM]

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    New Orleans, LA
    Posts
    37
    thanks! worked perfectly!

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