How can timestamps in a specific format be converted to a different format in PHP?

To convert timestamps in a specific format to a different format in PHP, you can use the `DateTime` class to parse the timestamp in the original format and then format it in the desired format using the `format()` method.

$timestamp = "2022-01-01 12:00:00";
$originalFormat = "Y-m-d H:i:s";
$newFormat = "d/m/Y";

$date = DateTime::createFromFormat($originalFormat, $timestamp);
$newTimestamp = $date->format($newFormat);

echo $newTimestamp; // Output: 01/01/2022