Hello friends - Lot of times you have to find only the date part of given datetime.
For example - If your application displays "09-jan-1987 08:48 PM" timestamp, you need to verify only date portion.
Vbscript provides function called datevalue which will return the date part of given date time stamp.
print datevalue("09-jan-1987 08:48 PM")
'It will print 09-01-1987 depending upon your system settings
To get the current system date you can use below syntax :-
print datevalue(now)
Please find below more questions and answers on date and time in QTP.
- How to extract date part from timestamp in QTP?
- How to find the name of month of given date in QTP?
- How to extract time part from given date in QTP?
- How to extract the second part from given time stamp in QTP?
- Explain dateadd function in qtp with Example.
- How to find future date in qtp?
- How to get the system date in qtp?
- How to verify the date format in qtp?
- How to find the yesterday's date in qtp
- How to find the date difference in qtp
- How to get the current system date in qtp?
- How to get the current year in qtp?
- How to find the name of week day for given date in QTP?
- Explain now function in qtp.
- 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