mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Better setup of default time zone from configuration file
This commit is contained in:
parent
6d6c53d42b
commit
d5f8e0347f
@ -597,10 +597,12 @@ void BaseDaemon::initialize(Application & self)
|
||||
/// This must be done before any usage of DateLUT. In particular, before any logging.
|
||||
if (config().has("timezone"))
|
||||
{
|
||||
if (0 != setenv("TZ", config().getString("timezone").data(), 1))
|
||||
const std::string timezone = config().getString("timezone");
|
||||
if (0 != setenv("TZ", timezone.data(), 1))
|
||||
throw Poco::Exception("Cannot setenv TZ variable");
|
||||
|
||||
tzset();
|
||||
DateLUT::setDefaultTimezone(timezone);
|
||||
}
|
||||
|
||||
std::string log_path = config().getString("logger.log", "");
|
||||
|
Loading…
Reference in New Issue
Block a user