Friday, 2 August 2013

Explain DateDiff function in QTP.

DateDiff function is used to find out the difference between 2 dates.

For example -
Suppose you know the date of birth of someone and want to find out the age of that person, you can use datediff function in this case.

DateDiff (Interval_Type, Date1, Date2)

Here Interval Type can be of below types.
yyyy -  Year
m  - Month
d  - Day
h  - Hour
n  - Minute
s  - Second

Example -

dateofbirth ="09-01-1986"
print datediff("yyyy", dateofbirth ,now)

'This will print your age in years

Please find below more questions and answers on date and time in QTP.

  1. How to extract date part from timestamp in QTP?
  2. How to find the name of month of given date in QTP?
  3. How to extract time part from given date in QTP?
  4. How to extract the second part from given time stamp in QTP?
  5. Explain dateadd function in qtp with Example.
  6. How to find future date in qtp?
  7. How to get the system date in qtp?
  8. How to verify the date format in qtp?
  9. How to find the yesterday's date in qtp
  10. How to find the date difference in qtp
  11. How to get the current system date in qtp?
  12. How to get the current year in qtp?
  13. How to find the name of week day for given date in QTP?
  14. Explain now function in qtp.
  15. Explain the datediff function in qtp.


Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.