Rails中的日期計算

 

  1. current_time = Time.now # => 2012-08-24 
  2. current_time + 2.year # => 2014-08-24 
  3. current_time - 5.month # => 2012-03-24 
  4. current_time + 7.day # => 2012-08-31 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章