Merge branch 'utc-fallback-no-tzdata' into date-lut-fix-uct

This commit is contained in:
Alexey Milovidov 2019-07-02 03:12:50 +03:00
commit 97a502fcb6

View File

@ -23,6 +23,7 @@ Poco::DigestEngine::Digest calcSHA1(const std::string & path)
return digest_engine.digest();
}
std::string determineDefaultTimeZone()
{
namespace fs = boost::filesystem;
@ -53,6 +54,10 @@ std::string determineDefaultTimeZone()
error_prefix = "Could not determine local time zone: ";
tz_file_path = "/etc/localtime";
/// No TZ variable and no tzdata installed (e.g. Docker)
if (!fs::exists(tz_file_path))
return "UTC";
/// Read symlink but not transitive.
/// Example:
/// /etc/localtime -> /usr/share/zoneinfo//UTC