Doc #61841 [Opn->Nab]: date_default_timezone_set

From: Date: Wed, 25 Apr 2012 05:09:17 +0000
Subject: Doc #61841 [Opn->Nab]: date_default_timezone_set
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8297@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61841&edit=1 ID: 61841 Updated by: dtajchreber@php.net Reported by: l_x_young at hotmail dot com Summary: date_default_timezone_set -Status: Open +Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: Linux PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Why not try 'UTC' like the manual page says? "The timezone identifier, like *UTC* or *Europe/Lisbon*. The list of valid identifiers is available in the List of Supported Timezones." http://codepad.org/YOBoEniH Previous Comments: ------------------------------------------------------------------------ [2012-04-24 18:02:02] l_x_young at hotmail dot com I also tried "UTC-12:00", this doesn't work either. ------------------------------------------------------------------------ [2012-04-24 18:00:03] l_x_young at hotmail dot com Description: ------------ --- From manual page: http://www.php.net/function.date-default-timezone-set#refsect1-function.date-default-timezone-set-parameters --- The manual says that you can supply the UTC for the timezone_identifier. This is not true. The function will not accept a UTC. Here is an example error message: Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID '(UTC-12:00)' is invalid Test script: --------------- $timeZone = "(UTC-12:00)"; // validate the timezone specified by the user $script_tz = date_default_timezone_get(); if ( !date_default_timezone_set($timeZone) ) { date_default_timezone_set($script_tz); trigger_error("Timezone is invalid.", E_USER_ERROR); } date_default_timezone_set($script_tz); Expected result: ---------------- I would like this function to accept a UTC for the timezone_identifier parameter. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61841&edit=1

« previous php.doc.bugs (#8297) next »