Anyway to *SET* the date & time?

Jeff jam at quark.emich.edu
Wed Oct 6 12:03:22 EDT 1999


On Wed, Oct 06, 1999 at 09:28:43AM +0000, Benjamin Schollnick wrote:
> 
> It's kinda a little pointless to run a time client and then have to
> manually set the time, you sort of loose the "millisecond" timing >weak
> grin<.
> 

ok, ok, you caught me being utterly sarcastic again ;)

my suggestion would be to implement the server in python, but leave the
client side to existing code, and then you won't have to worry about how to
do it.

> I am prepared to deal with this, I can have the client use the Sys module
> and make a system shell call to DATE & TIME, which will work under both
> OS/2 & Windows.
> 

> It's annoying, but I can work around it for said platforms.  *nix, and
> everything else are out of luck, since I don't know how to set their 
> clock, but........ That's what modifying the source if for.
> 

ack! I hope yer joking. ;)

I would advise *against* this type of approach to the problem, *especially*
when talking about a generic client like this.

> Honestly though, I think it's a semi long term gap that probably should be
> filled.  At least on a platform by platform basis.  After all STRPTIME
> isn't supported everywhere, why should TIME or DATE (or whatever they get
> called).
> 
> 			- Benjamin
> 

in my opinion facilities to set the date and time in a cross platform manner
would be a non-trivial excercise and a security violation of the machine. I
wouldn't want the average university student to walk up to a win32 machine
with pythonwin installed and be able to muck about with the date and time of
a machine with the simplicity of a function call-- at the least, a 'trick'
ought to be required (like using 'os.system' or a custom C extension) just
to keep things from getting out of hand. 

client software that uses the NTP protocol to set the date and time have
already been written for win32 and various other platforms, and a rewrite of
said clients in python would have limited value for the reasons we have been
discussing for the last several days-- it's a tricky topic.

the server side, on the other hand, is clean and elegant in python, and
ought to perform quite well, especially if replaced with something like
medusa as a server framework. 

in terms of filling a gap by implementing some sort of 'setclock' function
in the core python library, rest assured that guido and the other
maintainers have put many many many hours into these issues (python wasn't
born yesterday), and if there was a clean way to do it, they probably would
have done it by now.

I don't want to discourage your work-- if you can get something hacked up
that fills your requirements, by all means go for it.. but once things start
to get sticky after hacking away on something for a while, it sometimes
helps to step away from the current design and try something else--
including existing software.

have you made any other changes to the server code since you posted it?
would you be willing to repost or put it up on a web page someplace so
everyone can get the benefit of your experience?

regards,
J
-- 
|| visit gfd <http://quark.newimage.com/> 
|| psa member #293 <http://www.python.org/> 
|| New Image Systems & Services, Inc. <http://www.newimage.com/>




More information about the Python-list mailing list