QTP allows running different types of test. And sometimes, it needs perform time and date manipulations on a computer. In this article, I will show and explain - how to get system time/date and change them.
Actually, today's lecture consists of two questions:
Actually, today's lecture consists of two questions:
- How to get system time and date?
- How to set system time and date?
Let start training right now :)
So, the first section is:
How to get system time and date?
Actually, this is not difficult task! Use the following functions:
So, the first section is:
How to get system time and date?
Actually, this is not difficult task! Use the following functions:
- Now - function returns the current date and time according to the setting of your computer's system date and time.
- Date - function returns the current system date.
- Time - function returns a Variant of subtype Date indicating the current system time.
Well, let's deal with the second section:
How to set system time and date?
For that, I will use simple DOS commands:
time - this command displays or sets the system time: How to set system time and date?
For that, I will use simple DOS commands:
- To change: the time, pass it as a parameter to time command. See the above screen shot as an example.
- To change the date, pass it as a parameter to date command. See the above screen shot as an example for date manipulations :)




No comments:
Post a Comment