PHP date_default_timezone_set() Function

Definition and Usage

The date_default_timezone_set() function sets the default timezone used by all date/time functions.

Syntax

date_default_timezone_set(timezone)

Parameter Description
timezone Required. The timezone identifier, like "UTC" or "Europe/Paris". List of valid timezones: http://www.php.net/manual/en/timezones.php


Tips and Notes

Note: This function returns FALSE if the timezone identifier is not valid, or TRUE otherwise.

Example

<?php
echo(date_default_timezone_set("Europe/Paris"));
?>

OUTPUT :
1