Can someone point me to or write a script/program that takes X days and adds that to a given day dd/mm/yy and outputs the date in dd/mm/yy format. Thanks!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
In Ruby:
require 'rubygems'
require 'active_support'
def date_a(x, y)
(Date.parse(x) + y.days).strftime("%d/%m/%y")
end