Date Manipulation

Results 1 to 3 of 3

Thread: Date Manipulation

  1. #1
    DanMac Guest

    Default Date Manipulation

    Despite the possibly lewd title to this thread, I do have a sensible question :-)<BR><BR>I&#039;ve got a typical date field, with time, coming out of a database. I need to find out how far off that date and time is from the current date and time. So for example, if the stored date/time is 13/06/01 11:00 and the current date/time is 12/06/01 09:00 I should get something signifying 1 day, 2 hours. (using ddmmyy)<BR><BR>Is there a slightly more intelligent way of doing this than taking the date/time to bits as a string, then converting to individual integers, then subtracting from current day month year etc etc? (strikes me as an exceedingly menial task, besides, I don&#039;t like working with date/time :-)<BR><BR>TIA.

  2. #2
    Join Date
    Dec 1969

    Default DateDiff

    Use DateDiff(). You can then get the difference between the two date/time values down to the second if you want.<BR><BR>

  3. #3
    DanMac Guest

    Default RE: DateDiff

    Cheers, Gaby. Couldn&#039;t have asked for a better solution ... A dead handy function like that, built into VBScript. Whowudathunkit? :-)<BR><BR>Thanks again, and apologies for asking a question I could have answered by firing up the VBScript docs on my hard drive ... heheh ...

Posting Permissions

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