Skip to content

Commit 25b3126

Browse files
cosmo0920edsiper
authored andcommitted
in_winevtlog: Use -1 at the last argument for auto-detection of DST
FileTimeToLocalFileTime and SystemTimeToTzSpecificLocalTimeEx automatically convert between ST and DST. These functions are working well for DST conversions. Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent ecbf8c5 commit 25b3126

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/in_winevtlog/pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int pack_systemtime(struct winevtlog_config *ctx, SYSTEMTIME *st)
207207
st_local.wDay,
208208
st_local.wMonth-1,
209209
st_local.wYear-1900,
210-
st_local.wDayOfWeek, 0, 0};
210+
st_local.wDayOfWeek, 0, -1};
211211
len = _strftime_l(buf, 64, FORMAT_ISO8601, &tm, locale);
212212
if (len == 0) {
213213
flb_errno();
@@ -243,7 +243,7 @@ static int pack_filetime(struct winevtlog_config *ctx, ULONGLONG filetime)
243243
ft.dwLowDateTime = timestamp.LowPart;
244244
FileTimeToLocalFileTime(&ft, &ft_local);
245245
if (FileTimeToSystemTime(&ft_local, &st)) {
246-
struct tm tm = {st.wSecond, st.wMinute, st.wHour, st.wDay, st.wMonth-1, st.wYear-1900, st.wDayOfWeek, 0, 0};
246+
struct tm tm = {st.wSecond, st.wMinute, st.wHour, st.wDay, st.wMonth-1, st.wYear-1900, st.wDayOfWeek, 0, -1};
247247
len = _strftime_l(buf, 64, FORMAT_ISO8601, &tm, locale);
248248
if (len == 0) {
249249
flb_errno();

0 commit comments

Comments
 (0)