|
Home > Archive > IIS ASP > August 2004 > DateDiff
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| I am trying to replicate the Ebay Time Left on Auction.
1 Day, 1 hour, 12 minutes.
I would like to calculate this from the current time and date. How do I get
this result?
Thanks for the help.
| |
| Raymond 2004-08-27, 6:17 pm |
| Here is one way to do this:
Dim fDate, d, h, m
fDate = CDate("2004-08-28")
m = DateDiff("n",now(),fDate)
h = m\60
d = h\24
m = m - (60*h)
h = h - (24*d)
Response.Write(d&" days "&h& " hours "&m&" minutes")
Response.End()
--
Raymond Yap
"Jay" <jlytle@optonline.net> wrote in message
news:fsdXc.3473$ZD4.3849956@news4.srv.hcvlny.cv.net...
> I am trying to replicate the Ebay Time Left on Auction.
>
> 1 Day, 1 hour, 12 minutes.
>
> I would like to calculate this from the current time and date. How do I
get
> this result?
>
> Thanks for the help.
>
>
|
|
|
|
|