Could you please help me in fetching the correct result for days addition to current date.
app503l:datechecker ~ $ date
Thu May 18 13:54:41 AEST 2017
How can I add 55 days to it?
Could you please help me in fetching the correct result for days addition to current date.
app503l:datechecker ~ $ date
Thu May 18 13:54:41 AEST 2017
How can I add 55 days to it?
I got the solution..!
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});'
I have used perl to add 55 days to the current local time on the server.
Thanks..!
How about:
now=$(date +%s)
new=$((now + 55*86400))
date -r $new
With GNU date:
date -d @$new