DateTimeã«ç§ã足ãæ¹æ³ããªããªãè¦ã¤ãããªãã¦è¦å´ãããçµå±ActiveSupportã®ã½ã¼ã¹ããæ¢ããã Rationalã足ãã°è¯ãã require 'date' t = DateTime.now # 1ã¶æå¾ t >> 1 # 1æ¥å¾ t + 1 # 1æéå¾ (1/24æ¥å¾) t + Rational(1, 24) # 1åå¾ (1/1440æ¥å¾) t + Rational(1, 24 * 60) # 1ç§å¾ (1/86400æ¥å¾) t + Rational(1, 24 * 60 * 60) ç§ã足ããã¨ã°ããèãã¦ããã©ããRuby DateTime æéãã§æ¤ç´¢ããããã£ããè¦ã¤ãã£ãã http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/44399 ã§ãããã¥ã¢ã«ã«ãæ¸ãã¨ãã¦ã»ããã§ãããã£ãºãT
{{#tags}}- {{label}}
{{/tags}}