util: add new helper in_utc_timezone()

As the name suggests it checks whether we are running in an UTC
timezone.
This commit is contained in:
Lennart Poettering
2017-11-20 10:53:26 +01:00
parent 7c123d49fc
commit 9a9a4f10e9
3 changed files with 25 additions and 0 deletions
+6
View File
@@ -1457,3 +1457,9 @@ usec_t usec_shift_clock(usec_t x, clockid_t from, clockid_t to) {
/* x lies in the past */
return usec_sub_unsigned(b, usec_sub_unsigned(a, x));
}
bool in_utc_timezone(void) {
tzset();
return timezone == 0 && daylight == 0;
}