From 1a1657a7fc5c031b628e14eda831a2515c519eda Mon Sep 17 00:00:00 2001
From: Teo Mrnjavac <teo@kde.org>
Date: Fri, 26 Aug 2016 17:20:48 +0200
Subject: [PATCH] Set timezone on the live system too.

---
 src/modules/locale/LocalePage.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp
index 39a8b27c23..efe00e53bc 100644
--- a/src/modules/locale/LocalePage.cpp
+++ b/src/modules/locale/LocalePage.cpp
@@ -25,6 +25,7 @@
 #include "GlobalStorage.h"
 #include "JobQueue.h"
 #include "LCLocaleDialog.h"
+#include "Settings.h"
 
 #include <QBoxLayout>
 #include <QComboBox>
@@ -471,6 +472,15 @@ LocalePage::updateGlobalStorage()
     Calamares::JobQueue::instance()->globalStorage()
             ->insert( "locationZone", location.zone );
 
+    // If we're in chroot mode (normal install mode), then we immediately set the
+    // timezone on the live system.
+    if ( Calamares::Settings::instance()->doChroot() )
+    {
+        QProcess ::execute( "timedatectl",  // depends on systemd
+                            { "set-timezone",
+                              location.region + '/' + location.zone } );
+    }
+
     m_selectedLocaleConfiguration = guessLocaleConfiguration();
     updateLocaleLabels();
 }
-- 
GitLab