From: Saul Glass Date: 2011-11-03T18:41:53+09:00 Subject: Setting systems date and time - Windows Hi Guys, I am trying to write a script that updates the computers time to our servers time. On Ubuntu box it works like a charm but cant get it to work on a Windows box. Here is the code: def self.get_time begin response = get("xxxxxxxx", :basic_auth => { :username => "xxxxx", :password => "xxxxxx"}) if response.code == 200 puts response.body else puts "Couldnt get server time" end rescue puts "Couldn't get Time" end response.body end def self.sync begin time = self.get_time system("date -s +%m-%d-%Y +%T -s \"#{time}\"") rescue puts "Set Error" end end end Output: 2011-11-03 11:35:47 The system cannot accept the date entered. Enter the new date: (mm-dd-yy) Are there alternative methods for setting the systems date and time? Thanks -- Posted via http://www.ruby-forum.com/.