Windows SetLocalTime
Podi
podi.ex at gmail.com
Wed Dec 13 15:12:14 EST 2006
I am trying to set the system time on my Windows computer, but avoid
using the DOS command (date, time).
Does anyone know what parameter to pass to function SetLocalTime?
CSharp ref
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/813b4ef504f77a43/24fc37c6c9148961?lnk=gst&q=SetLocalTime&rnum=2#24fc37c6c9148961
Thanks a bunch,
P
>>> import ctypes
>>> import pywintypes
>>> t = pywintypes.Time(time.time())
>>> ctypes.windll.kernel32.SetLocalTime(t)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
ArgumentError: argument 1: exceptions.TypeError: Don't know how to
convert parameter 1
>>> ctypes.windll.kernel32.SetLocalTime(ctypes.addressof(t))
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
TypeError: invalid type
More information about the Python-list
mailing list