#35481 [Bgs->Asn]: Timezone error date_default_timezone_get()
| From: | sniper@php.net | Date: | Tue, 29 Nov 2005 22:28:02 +0000 |
| Subject: | #35481 [Bgs->Asn]: Timezone error date_default_timezone_get() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89427@lists.php.net to get a copy of this message | ||
ID: 35481
Updated by: sniper@php.net
Reported By: a dot schilder at gmx dot de
-Status: Bogus
+Status: Assigned
Bug Type: Date/time related
Operating System: Windows XP Home
PHP Version: 5.1.1
-Assigned To:
+Assigned To: derick
New Comment:
Assigned to the author.
Previous Comments:
------------------------------------------------------------------------
[2005-11-29 23:19:27] a dot schilder at gmx dot de
Of course, but IMHO this is the wrong behavior, because this function
does not "rely on the system's timezone settings", it returns the
current settings.
------------------------------------------------------------------------
[2005-11-29 22:56:08] sniper@php.net
Ever heard about @ ?
------------------------------------------------------------------------
[2005-11-29 22:49:52] a dot schilder at gmx dot de
Description:
------------
Using date_default_timezone_get() without having set a timezone before,
produces an error:
"It is not safe to rely on the system's timezone settings. Please use
the date.timezone setting, the TZ environment variable or the
date_default_timezone_set() function. We selected 'Europe/Paris' for
'1.0/no DST' instead".
I want to check the current timezone and this should be the correct
function for it. I want to get a result to work with
Reproduce code:
---------------
<?php
echo date_default_timezone_get();
?>
Expected result:
----------------
Get an empty string, like with "ini_get('date.timezone')"). Also false
or null would be okay.
Actual result:
--------------
Error message.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35481&edit=1