PHP date_timezone_get() Function

PHP date_timezone_get Function


Definition :

In php date_timezone_get() Function is inbuilt function.PHP date_timezone_get() function is used to return time zone relative to given DateTime value. It returns a DateTimeZone object as output on success or False on failure. It accepts only a single parameter $object which is the DateTime object returned by the date_create() function.

Syntax

   date_timezone_get(object)

Parameter
Parameter Description
object Required. Specifies a DateTime object returned by date_create().

Given below example the date_timezone_get() function returns the time zone of the given DateTime object.

Output : Asia/kolkata