Retrieve the timezone from the specified DateTime object.
| <?php $date=date_create(null,timezone_open(“Europe/Paris”)); $tz=date_timezone_get($date); echo timezone_name_get($tz); ?> |
The date_timezone_get() function retrieves the timezone of the specified DateTime object.
| date_timezone_get(object) |
|
Parameter |
Description |
|
object |
Required. Specifies a DateTime object created by date_create(). |
|
Return Value: |
Returns a DateTimeZone object on success; FALSE on failure. |
|
PHP Version: |
5.2+ |