'Output AWS cli sync command from bat file to log file with timestamp

I would like to run aws s3 sync on a scheduled bat file, logging the output to a file with timestamps. Here is the bat file:

cls
set ARG1=%1
if %ARG1%==test color 3d
if %ARG1%==prod color 4f
echo %DATE% %TIME%
aws s3 sync s3://bucket1/ s3://bucket2/ --no-progress --profile account.%ARG1% >> c:\temp\AWS\%ARG1%\log.txt 2>> c:\temp\AWS\%ARG1%\error_log.txt
TIMEOUT /T 5 /NOBREAK
exit 0

How do I add %DATE% and %TIME% to the output?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source