Sign in to follow this  
Followers 0
telmob

Independent clock possible?

3 posts in this topic

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!

Share this post


Link to post
Share on other sites



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>

Share this post


Link to post
Share on other sites

Thanks! That makes sense, but i'm such a noob i'll probably drown in all that info :mellow:

I'll try to figure it out. The help file usually helps...

Thanks again sleepydvdr

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0