// Instantiate DateTimeZone object for Los Angeles timezone $timezone = new DateTimeZone('America/Los_Angeles');
// Get all time zones supported by PHP $timezones = DateTimeZone::listIdentifiers(); // Display the list of time zones foreach($timezones as $tz) echo $tz.'
';
// Create a DateTime object with the current date and time in New York timezone $date = new DateTime('now', new DateTimeZone('America/New_York')); // Convert the date to Los Angeles timezone $date->setTimezone(new DateTimeZone('America/Los_Angeles')); // Display the date in Los Angeles time echo $date->format('Y-m-d H:i:s');The DateTimeZone class is part of the PHP core library, so it doesn't require any external packages or libraries.