Created
September 2, 2022 05:23
-
-
Save aileron/628e50cae2d0c41efe14321a988f93c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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