From 7ec2ab57617f6894f807551de786345ae3d779d6 Mon Sep 17 00:00:00 2001
From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org>
Date: Wed, 20 May 2015 11:16:41 +0100
Subject: [PATCH] Issue #2446859 by frob, jcnventura, mducharme, ge,
 mikeburrelljr: Installer warning: date_default_timezone_get(): It is not safe
 to rely on the system's timezone settings

---
 core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
index 2ad8dc50f58e..303586aa06bc 100644
--- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
+++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
@@ -205,7 +205,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     $form['regional_settings']['date_default_timezone'] = array(
       '#type' => 'select',
       '#title' => $this->t('Default time zone'),
-      '#default_value' => date_default_timezone_get(),
+      // Use system timezone if set, but avoid throwing a warning in PHP >=5.4
+      '#default_value' => @date_default_timezone_get(),
       '#options' => system_time_zones(),
       '#description' => $this->t('By default, dates in this site will be displayed in the chosen time zone.'),
       '#weight' => 5,
-- 
GitLab