在Rails环境之外引用Active Support

March 27, 2009

比如要算360天之后的日期:

require 'rubygems'
require 'date'
require 'active_support'

puts Date.today.advance(:days => 360).to_s

posted in Notes, Ruby and Rails by cowoo

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org