To convert the time zone of an existing DateTime
object to another, we can simply use the DateTime::setTimezone()
method in the following way:
$existingDateTime->setTimezone(new DateTimeZone('Europe/Berlin'));
You can get the list of supported time zones from the official PHP documentation.
Hope you found this post useful. It was published . Please show your love and support by sharing this post.