"Narendra C. Tulpule" wrote:
do you know how (or if) I can set time on a system using Python?
i.e. is there an equivalent of the shell's 'date -s' or the system
call settimeofday()?
Maybe some variation on this?
import os,time
def settimeofday(tt):
ts = time.ctime(tt)
os.system("/sbin/hwclock --set '--date=%s'"% ts)
os.system("/sbin/hwclock --hctosys")
??
Note the final line, which retrieves the time from the hardware so the
system clock is also updated.
-Peter