Date Differences

Results 1 to 2 of 2

Thread: Date Differences

  1. #1
    Join Date
    Dec 1969

    Default Date Differences

    Hi.<BR><BR>I am coding my own forum and want to display the last time a topic was updated: showing years/hours/mins/seconds. I just want a function that I can pass a date/time stamp (example 24/03/2003 15:43:22) and it would calculate the difference with Now().<BR><BR>The problem i experience is allowing for the fact that if a topic was last updated 1 year ago this needs to reflect on the day display, i.e. not show 365 days as it would already be displayed as 1 year, as a result the day then needs to reflect on the hours and so forth.....hope this makes sense.<BR><BR>Any help or a link to a website that can help would be greatly appreciated folks!<BR><BR>Cheers!

  2. #2
    Join Date
    Dec 1969

    Default RE: Date Differences

    Surely the easiest way would be to find the DateDiff (VBScript Reference link on the left, DateDiff function) of the dates in minutes. If that number&#039;s greater than 60*24, it&#039;s greater than a day. If it&#039;s greater than 60*24*356 then it&#039;s greater than a year... Yeah?<BR><BR>A select case statement should do the trick, shouldn&#039;t it?<BR><BR>Craig.

Posting Permissions

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