# perl -e 'print time' will return the current time in Unix epoch format # So if you substract 43200, that should give you the current time minus 30 minutes in Unix epoch format: time=$(perl -e 'print time-43200') #### 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