Doc #61841 [Com]: date_default_timezone_set

From: Date: Tue, 24 Apr 2012 18:02:02 +0000
Subject: Doc #61841 [Com]: date_default_timezone_set
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8294@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 Comment by: l_x_young at hotmail dot com Reported by: l_x_young at hotmail dot com Summary: date_default_timezone_set Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Linux PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I also tried "UTC-12:00", this doesn't work either. Previous Comments: ------------------------------------------------------------------------ [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 (#8294) next »