Re: Is there a better way to set a system clock in Python (on a Linux system)

2010-05-13 Thread Lawrence D'Oliveiro
In message , J wrote: > Like I said, it works well, I just wonder if there is a cleaner way of > setting the local clock to a different time in python without having > to do all this. How about one line in Bash: date -s $(date --rfc-3339=date -d "+1 hour") -- http://mail.python.org/mailman

Re: Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread KDr2
man 2 clock_settime call it with ctypes -- Best Regards, -- KDr2 http://kdr2.net On Thu, May 6, 2010 at 10:47 AM, J wrote: > Is there a better way to do this? > > def SkewTime(): >''' >Optional function. We can skew time by 1 hour if we'd like to see real > sync >changes bein

Re: Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread Chris Rebert
On Wed, May 5, 2010 at 7:47 PM, J wrote: > Is there a better way to do this? Yes: from datetime import datetime, timedelta > def SkewTime(): >    ''' >    Optional function. We can skew time by 1 hour if we'd like to see real sync >    changes being enforced >    ''' >    TIME_SKEW=1 >    loggin

Is there a better way to set a system clock in Python (on a Linux system)

2010-05-05 Thread J
Is there a better way to do this? def SkewTime(): ''' Optional function. We can skew time by 1 hour if we'd like to see real sync changes being enforced ''' TIME_SKEW=1 logging.info('Time Skewing has been selected. Setting clock ahead 1 hour') # Let's get our current ti