Difference between 2 times

  • Thread starter Michael Keyloun
  • Start date
M

Michael Keyloun

Is there a way to create a macro that calculates the difference between a
user-defined timestamp and the current date and time?

(I've read on this newsgroup how to calculate the difference between two
dates...I'm wondering if/how to include the current time in a similar
calculation).

Thanks for your help,
Michael
 
P

Peter Hewett

Hi Michael Keyloun

You can use DateDiff to calculate the difference between two dates (which includes the
time). You can calculate and return the differences between two dates using any of the
following time intervals:

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

You can use syntax such as:
DateDiff("s","01 01 2004 00:00:00", "01 01 2004 01:00:00")

If this does not answer your quest post again with more specific requirements.

HTH + Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top