Calculating Date and time

K

Karan

Dear all,

I want to calculate the time difference between two dates. I have set the
date/time property to "General Date". For Ex. which shows like "15.03.2005
04:48:00 PM"

Say i have a previous date/time of "14.03.2005 05:48:00 PM".

I want to subtract the previous from todays. Which should be in the hour
format for EX: 23 (hours).

Can anyone help me!! thanks in advance.

Karan.
 
D

Dennis

Hi Karan,

There is a bulit in function called DateDiff. Look up this function in the
help and it shows all different ways of calculating with dates and times.

Dennis.
 
K

Karan

Mr. Dennis,

Thanks a lot for your valuable help. I got close but, couldn't able to do
what i wanted. The example which is in help, It shows in days. like
difference of 1 day or 2 days.

I want it in hours and minues.

For example: 15.03.2005 04:48:00 PM is the previous date/time and 15.03.2005
06:02:00 PM is later date/time.

if i find the date/time difference it should show 01:14.

any help, will be highly appreciated.

thanks and have a nice day !!

Karan.
 
D

Dennis

Hi Karan,

If you use DateDiff("h",date1,date2) this will give the difference in hours.
DateDiff("n",date1,date2) will give the difference in minutes.

Dennis.
 
Top