Fixed setting timezone on RPI
@@ -264,6 +264,8 @@ void DeRestPluginPrivate::initTimezone()
if (getenv("TZ") != gwTimezone)
{
setenv("TZ", qPrintable(gwTimezone), 1);
+ //also set zoneinfo on RPI
+ symlink("/usr/share/zoneinfo/" + timezone, "/etc/localtime");
}
}
tzset();
@@ -1960,6 +1962,9 @@ int DeRestPluginPrivate::modifyConfig(const ApiRequest &req, ApiResponse &rsp)
int rc = setenv("TZ", qPrintable(timezone), 1);
tzset();
+ //also set zoneinfo on RPI
+ symlink("/usr/share/zoneinfo/" + timezone, "/etc/localtime");
+
if (rc != 0)
{
rsp.list.append(errorToMap(ERR_INTERNAL_ERROR, QString("/config/timezone"), QString("Error setting timezone")));
