As an aside:
# perl -e 'print time' will return the current time in Unix epoch form
+at
# So if you substract 43200, that should give you the current time min
+us 30 minutes in Unix epoch format:
time=$(perl -e 'print time-43200')
There are 86400 seconds in a day, so subtracting 43200 subtracts half a day. Subtract 1800 to go back half an hour.
c:\@Work\Perl\monks>perl -wMstrict -le
"my $t = time;
print $t;
print scalar localtime $t;
print scalar localtime $t - 43200;
print scalar localtime $t - 1800;
"
1597857155
Wed Aug 19 13:12:35 2020
Wed Aug 19 01:12:35 2020
Wed Aug 19 12:42:35 2020
See
time,
localtime,
gmtime.
Give a man a fish: <%-{-{-{-<