Jednoduchý klient
require "net/telnet"
timeserver = "www.fakedomain.org"
tn = Net::Telnet.new("Host" => timeserver,
"Port" => "time",
"Timeout" => 60,
"Telnetmode" => false)
local = Time.now.strftime("%H:%M:%S")
msg = tn.recv(4).unpack('N')[0]
# Conver to epoch
remote = Time.at(msg - 2208988800).strftime("%H:%M:%S")
puts "Local : #{local}"
puts "Remote: #{remote}"