开发者

Script that adds X days to a given date?

开发者 https://www.devze.com 2023-02-28 13:56 出处:网络
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!In Ruby:

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!


In Ruby:

require 'rubygems'
require 'active_support'

def date_a(x, y)
  (Date.parse(x) + y.days).strftime("%d/%m/%y")
end
0

精彩评论

暂无评论...
验证码 换一张
取 消