I was looking for a way of including the date in a filename and can across this answer. So I tried
touch "$(date +"%Y_%m_%d_%I_%M_%p").log"
and touch $(date +"%Y_%m_%d_%I_%M_%p").log
and both returned:-How can I do this under FreeBSD?Illegal variable name.