Script that adds X days to a given date?

2019-08-18 02:54发布

问题:

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


标签: date calendar