我在基于 symfony2 的应用程序中遇到奇怪的错误。在每个使用表格的页面上,我得到
E_WARNING: DateTimeZone::__construct(): Unknown or bad timezone (1024)
仅供参考,我正在调用
date_default_timezone_set("Europe/Warsaw");
在 AppKernel::init() 中。知道如何摆脱这个警告吗?提前致谢。
编辑
这是我来自 NewRelic 的堆栈跟踪
…or/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php (542)
…or/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/DateType.php (274)
…or/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/DateType.php (88)
…/shared/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php (167)
…/shared/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php (164)
…/shared/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php (126)
…zy.pl/shared/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php (87)
…zy.pl/shared/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php (114)
…zy.pl/shared/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php (342)
…zy.pl/shared/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php (230)
…zy.pl/shared/vendor/symfony/symfony/src/Symfony/Component/Form/in Symfony\Component\Form\FormBuilder::getForm called at /var/www/tumamoczy.pl/shared/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php FormFactory.php (47)
…endor/friendsofsymfony/user-bundle/FOS/UserBundle/Form/Factory/FormFactory.php (33)
…endsofsymfony/user-bundle/FOS/UserBundle/Controller/RegistrationController.php (48)
in FOS\UserBundle\Controller\RegistrationController::registerAction called at ? (?)
…alled at /var/www/tumamoczy.pl/releases/20130602213844/app/bootstrap.php.cache (1003)
…alled at /var/www/tumamoczy.pl/releases/20130602213844/app/bootstrap.php.cache (977)
…alled at /var/www/tumamoczy.pl/releases/20130602213844/app/bootstrap.php.cache (1103)
…alled at /var/www/tumamoczy.pl/releases/20130602213844/app/bootstrap.php.cache (413)
…el::handle called at /var/www/tumamoczy.pl/releases/20130602213844/web/app.php (21)
看起来警告出现在 StubIntlDateFormatter.php 中,对吗?那么这是 Symfony2 的问题吗?它甚至可以解决吗?