I'm trying to sort the difference from the today date and last 5 days with this command.
Command:
DIFFERENCE_DAYS=$(( ($(date '+%s') - $(date '+%s' -d ${Created_Date})) / 86400 ))
Getting this error:
find PR older than 5days and delete from repo
Branch name: "pull-req5"
PR created at date: "2022-05-26T17:50:36Z"
date: illegal time format
usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]]
[-I[date | hours | minutes | seconds]]
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
./git_personal_repo.sh: line 47: (f - ) / 86400 : syntax error: operand expected (error token is ") / 86400 ")