We can get it using the code below, I handled the case when I had to go through dates from the last 3 months, I used the code below to go through the same
! / Ben / w
for i in {90..1} do st_dt=$(date +%F' 00:00:00' -d "-$i days") echo $st_dt j=$((i-1)) end_dt=$(date +%F' 00:00:00' -d "-$j days") echo $end_dt done
source share