how to get the time stamp in php code example Example: php datetime object get unix timestamp $date = new DateTime(); echo $date->getTimestamp();