Home > Uncategorized > How To Get Time Difference Between Two Dates

How To Get Time Difference Between Two Dates

Overview

This How-To will show you how to get the Time Difference in between two date questions.

  1. Let’s say we have for example two date questions:
  2. After both date questions were answered, in order to get the Time Difference in days between them, I would write this function:
    Round(TimeDiffDays(Answer(2),Answer(1)));

    If I answered in question1:
    12\23\2012
    and in question2:
    12\30\2012

    It will return 7.

    The Right parameter is the older date; the Left parameter is the newer date.
    The Round function will just return an integer instead of a non-integer number.

    You can use this returned value wherever you need in your survey

  3. The time diff function is also valid for seconds\hours\days\months\years, here are the rest of them:

    TimeDiffSeconds

     TimeDiffHours

     TimeDiffDays

     TimeDiffMonths

     TimeDiffYears

That’s it !

Visit us at: http://www.dooblo.net

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: