Forum Discussion

rac8006's avatar
rac8006
Copper Contributor
Jul 14, 2026

incorrect time issue

I use a powershell script to put the PC to S3 sleep mode.  Just before the system suspends I display a message system suspending 1:38:00 AM. I also write to the application event log which shows the same time.  When I wake the system I wait 10 seconds and writehost a message waking up from sleep  but the time that get displayed is 1:38:10 AM.  I continue to sleep for 10 seconds then 20 seconds after each sleep I write to the event log and each log entry get the time stamp of 1:38:20AM then 1:38:40AM.  But in the system event log I get I get an entry saying that the system woke up at 1:50:00PM which is the correct time.  Then I get  ID 107 entry that has the time of 1:38:10AM  then a event id 1 which has the 1:50:00PM.  From then on the system event have the correct time.

My question is why does the powershell script run for over a minute and getting and logging the time close to when it went to sleep? 

1 Reply

  • Josefaou's avatar
    Josefaou
    Tin Contributor

    Use schtasks or a startup script to force time synchronization after waking.