How to echo current datetime in Linux bash shell

You can get curent datetime in Linux bash shell with commands as following:

var=$(date)
var=`date`

Then in the bash shell file you can print current datetime with echo command like below:

echo "Current date: $now" 

The final example looks like this:

#!/bin/bash
now=`date`
echo "[$now]Setting environment parameter ..." 
Related:  cpulimit for FreeBSD