need your suggestion for a date time problem

   I want to know how I can calculate the difference of two dates by days, hours, minutes, and seconds.
For instance,
  Let's say today is 11/06/99 12:00:00pm
And I want to know how many days. hours, minutes and secondsthere are to get to 14/06/99 1:00:00pm. Can you suggest an algorithm?
Thanks for reading
Who is Participating?
danlevansConnect With a Mentor Commented:
DateDiff(interval, date1, date2

The interval argument has these settings:

Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second

Run a datediff for each part days, hours, minutes, seconds.
whlukAuthor Commented:
Edited text of question.
whlukAuthor Commented:
if i do this
Msgbox ("d", timeNow, newDate)
message box will show up "7 days"
if i do a subsequant tabulation after the statement above...
MsgBox ("h", timeNow, newDate)
message box will show up "132 hours"
which is not what I expect...(the first statement does not subtract the 7 days from timeNow)
I would like to see it's within the 24-hour clock! like 5 hours or something
whlukAuthor Commented:
the statement should say
MsgBox (DateDiff ("d", timeNow, newDate)
Sorry for making you confused
All Courses

From novice to tech pro — start learning today.