how to get date from timestamp object in php code example Example: php date object to timestamp $date = new DateTime(); echo $date->getTimestamp();