efficient way of changing system date
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
efficient way of changing system date
Hi,
I musn't be the only one who need to change its system datetime while executing tests...
I tried two ways, this one :
net time /set /yes
and this one :
w32tm /resync
with the command line, but both don't work 100% of the time.
Does anyone has any workaround ?
Thank you
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stop the W32Time service before changing date/time because unless that the time will be resync automatically after short time.
You can stop it using cmd in administrator mode with NET STOP W32Time /YES
To change machine date/time use DATE and TIME in cmd
If not working with NET STOP you can use SC object.
Un sourire et ça repart
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What OS are You using?
Take a look at this article, maybe this can help You?
https://www.wikihow.com/Change-the-Computer-Time-and-Date-Using-the-Command-Prompt
inside cms console, You can use a command like: "HH:MM:SS AM/PM" or the similar one for date-time. On windows ofc.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We've actually been successful using aqDateTime.SetSystemDateTime.
It requires TestComplete/TestExecute to be run with admin privileges and, as noted above, you might want to stop any network time synchronization to make sure you can preserve your expected time.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Seems to be the cleanest way to resolve my problem ! Thank you !
I'm on windows 10.
I already have a clue for preventing the PC resetting the date. For this key :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
I set "Type" to "NoSync".
Thus the domain controller leave my machine alone.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you get back to current time Robert ?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What we did is, before we changed the time, we captured the current date and time (using the "Get" method) and stored it in a variable. Then, we just used that as part of the next "Set" statement to restore.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
