Some time ago, this post appeared asking how to use Python to change system date and time. The answer by Amir on that post worked for me, and I'm able to use his same script to change my computers date and time as displayed on the bottom-right of my screen to whatever I want it to. However, I'm now trying to create a second, slightly modified script to reset date and time to what it should be in real time. So the idea is, I can execute one script and then change my system date and time. Then, I execute a second script and reset the system date and time to what it "should be", in real time, as it was before I ran the first script. I've not been able to figure it out so far though. In Amir's script, the following code was used;
time_tuple = (2012, # Year
9, # Month
6, # Day
0, # Hour
38, # Minute
0, # Second
0, # Millisecond
)
I thought I'd be able to make this work by simply making the following modification;
import time
time_tuple = time.gmtime()[0:7]
The <time.gmtime()[0:7]> hypothetically has a tuple which contains the real, present-time at the moment. And I used [0:7] to match the seven values in the original tuple. But when I run this code, it does not reset my computers system date and time to real-time. (It doesn't help when I remove the [0:7].) Does anyone know something that will work here?