2015-07-26 あの日は何曜日? Ruby Ruby よくあるプログラミングの問題で「あの日は何曜日?」というものがある。 でもRubyだと簡単だ。 #!/usr/bin/ruby -EUTF-8 require 'date' ARGV.each{|x| d = Date.parse(x) p d.strftime('%a') } 実行すると、 $ ruby uru.rb 1967/11/14 "Tue" $ _うん。 1967年11月14日は火曜日だったんですねえ。