$timezone = new DateTimeZone('America/New_York'); echo $timezone->getName(); // Output: America/New_York
$timezone = new DateTimeZone('Asia/Tokyo'); echo $timezone->getName(); // Output: Asia/TokyoThis example is similar to Example 1, but we have used a different timezone ID. Package Library: This function is part of the PHP's core date and time functions and does not require any external package or library.