ruby-01-basic.rb 162 Bytes
Newer Older
epsi sayidina's avatar
epsi sayidina committed
1 2 3 4 5
#!/usr/bin/ruby

timeformat = '%a %b %d %H:%M:%S'

while true do
epsi sayidina's avatar
epsi sayidina committed
6 7 8
  localtime = Time.now
  datestr = localtime.strftime(timeformat)
  puts datestr
epsi sayidina's avatar
epsi sayidina committed
9

epsi sayidina's avatar
epsi sayidina committed
10
  sleep(1)
epsi sayidina's avatar
epsi sayidina committed
11
end