Skip to content

Commit ecbf8c5

Browse files
cosmo0920edsiper
authored andcommitted
in_winevtlog: Handle Daylight saving time by using newer functions
* SystemTimeToTzSpecificLocalTimeEx * GetDynamicTimeZoneInformation are able to handle Daylight Saving Time(DST). Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent e82fe24 commit ecbf8c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/in_winevtlog/pack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ static int pack_systemtime(struct winevtlog_config *ctx, SYSTEMTIME *st)
189189
CHAR buf[64];
190190
size_t len = 0;
191191
_locale_t locale;
192-
TIME_ZONE_INFORMATION tzi;
192+
DYNAMIC_TIME_ZONE_INFORMATION dtzi;
193193
SYSTEMTIME st_local;
194194

195-
GetTimeZoneInformation(&tzi);
195+
GetDynamicTimeZoneInformation(&dtzi);
196196

197197
locale = _get_current_locale();
198198
if (locale == NULL) {
199199
return -1;
200200
}
201201
if (st != NULL) {
202-
SystemTimeToTzSpecificLocalTime(&tzi, st, &st_local);
202+
SystemTimeToTzSpecificLocalTimeEx(&dtzi, st, &st_local);
203203

204204
struct tm tm = {st_local.wSecond,
205205
st_local.wMinute,

0 commit comments

Comments
 (0)