[glib/backport-2449-2600-mingw-test-fixes-glib-2-72: 1/6] gdate.c: Use standard name if no daylight saving exists
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/backport-2449-2600-mingw-test-fixes-glib-2-72: 1/6] gdate.c: Use standard name if no daylight saving exists
- Date: Thu, 14 Apr 2022 12:19:44 +0000 (UTC)
commit b47e7b35039d7927b9bae8a40c5c2d534693a49b
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Apr 11 12:17:25 2022 +0800
gdate.c: Use standard name if no daylight saving exists
We should normally have a standard name for the time zone even if we don't
have daylight saving in the time zone, so use the standard name also when
GetTimeZoneInformation() returns TIME_ZONE_ID_UNKNOWN[1][2].
[1]: https://docs.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-gettimezoneinformation
[2]: https://docs.microsoft.com/zh-tw/windows/win32/api/timezoneapi/nf-timezoneapi-settimezoneinformation
glib/gdate.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/glib/gdate.c b/glib/gdate.c
index 73a732df30..68c8689ef4 100644
--- a/glib/gdate.c
+++ b/glib/gdate.c
@@ -2556,9 +2556,7 @@ win32_strftime_helper (const GDate *d,
break;
case 'Z':
n = GetTimeZoneInformation (&tzinfo);
- if (n == TIME_ZONE_ID_UNKNOWN)
- ;
- else if (n == TIME_ZONE_ID_STANDARD)
+ if (n == TIME_ZONE_ID_UNKNOWN || n == TIME_ZONE_ID_STANDARD)
g_array_append_vals (result, tzinfo.StandardName, wcslen (tzinfo.StandardName));
else if (n == TIME_ZONE_ID_DAYLIGHT)
g_array_append_vals (result, tzinfo.DaylightName, wcslen (tzinfo.DaylightName));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]