Page 1 of 1

Setting the computer time from a script

Posted: Mon Nov 27, 2023 10:36 pm
by Jean-Francois
Hello Robin,

With the QHY-174GPS, it is possible to set the time of the computer with the time coming from the camera GPS.

Is it possible to do the same from a script ?
My idea is to have the time set at the beginning of my script.

Regards,
Jean-Francois

Re: Setting the computer time from a script

Posted: Tue Nov 28, 2023 1:41 pm
by admin
Hi,

it's non-trivial to try to set the system time from within SharpCap IronPython - you have to declare a class with special attributes to allow calling SetSystemTime from kernel32.dll - it's probably easier to launch a power shell script to do the same using Set-Date which is built into PowerShell.

https://learn.microsoft.com/en-us/power ... rshell-7.4

cheers,

Robin

Re: Setting the computer time from a script

Posted: Tue Nov 28, 2023 8:52 pm
by Jean-Francois
Hello Robin,

OK, not so easy. I will first do it manually.

Jean-Francois