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