无法访问 GNU 日期的 AIX 上的日期算法

Date arithmetic on AIX with no access to GNU date

你能帮我获取当前日期增加天数的正确结果吗?

app503l:datechecker ~ $ date
Thu May 18 13:54:41 AEST 2017

如何添加 55 天?

怎么样:

now=$(date +%s)
new=$((now + 55*86400))
date -r $new

GNU 日期:

date -d @$new

我得到了解决方案..!

a=55
export a
perl -e 'use POSIX qw(strftime); print strftime "%a %b %e %H:%M:%S %Y",localtime(time()+ 3600*24*$ENV{a});'

我已经使用 perl 将服务器上的当前本地时间增加了 55 天。

谢谢..!