# need your suggestion for a date time problem

Hi,
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?
Jacky
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Author Commented:
Edited text of question.
0
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.
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author 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
0
Author Commented:
the statement should say
MsgBox (DateDiff ("d", timeNow, newDate)
Sorry for making you confused
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.