get current timestamp shell

C++
// If you want to get unix timestamp, then you need to use:
timestamp=$(date +%s)
Source

Also in C++: