You can use the class DateTimeZone:
$gmt = new DateTimeZone("GMT");
$datetimeInGMT = new DateTime($now, $gmt);
It also takes up space in the form continent/city, for example. Europe/London.
If your datetime is not UTC, you can use setTimezone:
$datetimeInGMT = new DateTime($now, new DateTimeZone("America/New_York"));
$datetimeInGMT->setTimezone(new DateTimeZone("GMT"));
source
share