the syntax -how to output recent date and time to log file of the date command is like this:

#!/bin/bash
echo "firewall started on: "$(date '+%Y-%m-%d-%H:%M:%S')" >> /var/log/firewall.log

other examples:

date '+%Y-%m-%d-%H:%M:%S'
# or
echo $(date '+%Y-%m-%d-%H:%M:%S')
admin