PHP date_timezone_get()Functions

PHP Date/TimePHP Date/Time Reference Manual

Examples

Returns the timezone of the given DateTime object:

<?php
$date=date_create(null,timezone_open("Europe/Paris"));
$tz=date_timezone_get($date);
echo timezone_name_get($tz);
?>

Run example »

Definition and Usage

The date_timezone_get() function returns the timezone of a given DateTime object.

Syntax

date_timezone_get(object);

Parameters Description
object Required. Specifies adate_create()DateTime object returned by

Technical Details

Return value: Returns a DateTimeZone object on success, or FALSE on failure.
PHP Version: 5.2+


PHP Date/TimePHP Date/Time Reference Manual Other extensions