how to get date from timestamp in php code example Example: php datetime to timestamp $time = '2021-03-31 23:59:00'; strtotime($time);