command substitution is an expansion that replaces a command expression with the resulting stdout of the command.
$( ) executes in a subshell
current_date=$(date)
echo "The current date and time is: $current_date"
echo "The current date and time is: $(date)"
Old with backtick `` that executes in the same shell
current_date=`date`