Removed "awk -F "T" '{printf "%s\n", $1}'" from snapshot_date variable. This truncates the returned snapshot StartTime - but also removes the timezone information, which is needed for correct 'snapshot_date_in_seconds' date conversion.
More explicitly: the problem here is that the time component also includes the timezone marker ("Z" for Zulu). This means that the following 'date' call interprets the returned StartTime as the servers' local time... which is likely incorrect (unless server is set to UTC).
Note, 'date --date ....' can already interpret the time string returned from AWS as is (it's in ISO format) - so not sure why we might need to truncate all characters after "T"...
Removed "awk -F "T" '{printf "%s\n", $1}'" from snapshot_date variable. This truncates the returned snapshot StartTime - but also removes the timezone information, which is needed for correct 'snapshot_date_in_seconds' date conversion.
More explicitly: the problem here is that the time component also includes the timezone marker ("Z" for Zulu). This means that the following 'date' call interprets the returned StartTime as the servers' local time... which is likely incorrect (unless server is set to UTC).
Note, 'date --date ....' can already interpret the time string returned from AWS as is (it's in ISO format) - so not sure why we might need to truncate all characters after "T"...