timestamp get Time code example
Example 1: get current timestamp shell
// If you want to get unix timestamp, then you need to use:
timestamp=$(date +%s)
Example 2: DateTime and Timestamps
$dateTime = new DateTime('2016-05-20');
echo $dateTime->getTimestamp();
# Output: 1271802325