telmob Posted August 31, 2011 Share Posted August 31, 2011 Hello. I'm doing a project that needs to alter the system time and date to a previous or later value and then to revert ir again to the correct time and date. I've seen here on the forums a way to do this: #include <Date.au3> $tCur = _Date_Time_GetSystemTime() $Date = "01.01.2010" Run(@ComSpec & " /c " & "date " & $Date, "", @SW_HIDE) Sleep(2000) _Date_Time_SetSystemTime(DllStructGetPtr($tCur)) But if i increase the delay on sleep to 10 seconds, the time will be late ten seconds. Is there a way to change the time back to the correct actual time without the use of the internet? Thanks! Link to comment Share on other sites More sharing options...
sleepydvdr Posted August 31, 2011 Share Posted August 31, 2011 Perhaps you can use _NowCalc, TimerInit and TimerDiff to create a value of a point in time, calculate how long your script has been running, and finally go back to the original time and add the difference back to it. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
telmob Posted August 31, 2011 Author Share Posted August 31, 2011 Thanks! That makes sense, but i'm such a noob i'll probably drown in all that info I'll try to figure it out. The help file usually helps... Thanks again sleepydvdr Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now