Skip to content

Instantly share code, notes, and snippets.

@aileron
Created September 2, 2022 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aileron/628e50cae2d0c41efe14321a988f93c9 to your computer and use it in GitHub Desktop.
Save aileron/628e50cae2d0c41efe14321a988f93c9 to your computer and use it in GitHub Desktop.
require 'time'
wd = ["日", "月", "火", "水", "木", "金", "土"]
while line = gets
begin
pos = line.index('\t')
time_text = line[0..pos]
cmd = line[pos..line.size].strip
time = Time.parse(time_text)
date = time.strftime '%Y-%m-%d'
print "#{date}(#{wd[time.wday]})\t#{time.strftime('%H:%M')}\t#{cmd}\n"
rescue
nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment