diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 837948c253..f5be619ad6 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -1258,6 +1258,7 @@ int get_timezones(char ***ret) { } strv_sort(zones); + strv_uniq(zones); } else if (errno != ENOENT) return -errno; @@ -1277,6 +1278,10 @@ bool timezone_is_valid(const char *name, int log_level) { if (isempty(name)) return false; + /* Always accept "UTC" as valid timezone, since it's the fallback, even if user has no timezones installed. */ + if (streq(name, "UTC")) + return true; + if (name[0] == '/') return false;