You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Time offset splits date and time wrongly for German month-name timestamps (dd MMM yyyy) #759
SquareBracketColumnizer and TimestampColumnizer show wrong date and time columns when a time offset is set and the timestamp uses one of the German month-name formats (dd MMM yyyy HH:mm:ss[,.fff], formatInfo13–formatInfo15 in TimeFormatDeterminer).
Cause
TimeFormatDeterminer only recognises these lines when the month is exactly 3 characters (span[6] == ' '), e.g. 21 Mär 2022 11:34:34.505.
With a non-zero offset, the columnizer parses the timestamp, adds the offset and formats it again with dd MMM yyyy … in de-DE.
When the format string has dd MMM, .NET formats the month from the genitive abbreviations: Jan.|Feb.|März|Apr.|Mai|Juni|Juli|Aug.|Sept.|Okt.|Nov.|Dez. These are 3 to 5 characters long. The month names it reads in are Jan|Feb|Mär|…, always 3 characters.
The date and time columns are then cut by the format-string lengths (dateLen = "dd MMM yyyy".Length, timeLen = TimeFormat.Length), not from the reformatted string. In SquareBracketColumnizer.SquareSplit that's line[..dateLen] and line.Slice(dateLen + 1, timeLen). In TimestampColumnizer.SplitLine (around lines 105–106) it's newDate[..dateLen] and newDate.Slice(dateLen + 1, timeLen).
So for every month except May, the reformatted timestamp is 1 or 2 characters longer than the slices expect.
Steps to reproduce
Open a log with lines like 21 Mär 2022 11:34:34.505[INFO][Worker]Message.
Use the SquareBracket (or Timestamp) columnizer.
Set a time offset, e.g. +123 ms.
Expected: the date column shows the date, and the time column shows 11:34:34.628.
Actual: the reformatted timestamp is 21 März 2022 11:34:34.628. The date column shows 21 März 202 and the time column shows 2 11:34:34.6. With Sept. it is off by 2 characters. A May timestamp shifted across the month boundary also breaks (31 Mai → 01 Juni).
The bracket fields and message are right after #754, because the split position now comes from newDate.Length. Only the date and time columns are affected.
Suggested direction
Find the date/time boundary in the reformatted string itself, not from the format-string lengths. For example, split newDate at the separator between the date and time parts. Or format the date and time halves separately (dateTime.ToString(DateFormat) and dateTime.ToString(TimeFormat)). Formatting with the same 3-letter month names the parser accepts would also keep the column shape.
Acceptance criteria
A test that shifts 21 Mär 2022 11:34:34.505 by +123 ms gives the date column 21 Mär 2022 (or 21 März 2022, whichever is chosen) and the time column 11:34:34.628. This holds for both SquareBracketColumnizer and TimestampColumnizer.
Covered: a 4-character month (März), a 5-character month (Sept.) and a shift across a month boundary (31 Mai → 01 Jun…).
Category: bug Summary: With a time offset, German dd MMM yyyy timestamps must be re-formatted with the same 3-letter month names the log uses, so the date and time columns split correctly.
Depends on:#754. Start once it is merged, or on its branch. #754 changes the same offset path in SquareBracketColumnizer, and this issue assumes its behavior (bracket fields and message split from newDate.Length).
Verified (on .NET, de-DE):
ParseExact("21 Mär 2022 11:34:34.505", "dd MMM yyyy HH:mm:ss.fff", de-DE) + 123 ms, formatted with the same format, gives 21 März 2022 11:34:34.628.
With dd MMM, .NET uses AbbreviatedMonthGenitiveNames (Jan.|Feb.|März|Apr.|Mai|Juni|Juli|Aug.|Sept.|Okt.|Nov.|Dez.): 3 to 5 chars. The log and the parser use AbbreviatedMonthNames (Jan|Feb|Mär|…|Dez): always 3 chars. Only May has the same length.
31 Mai 2022 23:59:59.950 + 123 ms gives 01 Juni 2022 00:00:00.073.
Formatting the date half on its own (ToString("dd MMM yyyy")) still uses the genitive names, so splitting into two ToString calls does not keep the 3-letter form.
A de-DE CultureInfo clone whose DateTimeFormat.AbbreviatedMonthGenitiveNames is set to its AbbreviatedMonthNames formats 21 Mär 2022 11:34:34.628, 01 Sep 2022 … and 01 Jun 2022 ….
Current behavior:
With a non-zero time offset, TimestampColumnizer.SplitLine and SquareBracketColumnizer (SplitLine → SquareSplit) parse the timestamp, add the offset, format it again with formatInfo.DateTimeFormat / formatInfo.CultureInfo, and then cut the date and time columns by the format-string lengths (DateFormat.Length, TimeFormat.Length). For formatInfo13–formatInfo15 in TimeFormatDeterminer (dd MMM yyyy + HH:mm:ss[,.fff], de-DE), the formatted month is longer than 3 chars, so:
the date column shows 21 März 202 and the time column 2 11:34:34.6 (off by 2 chars for Sept.);
GetTimestamp breaks too: both columnizers rebuild the timestamp from columns 0 and 1 ("21 März 202" + " " + "2 11:34:34.6"), ParseExact throws, and the line gets DateTime.MinValue. With an offset set, these lines lose their timestamp, which affects everything that uses it (time sync, timestamp navigation, time-based filtering).
Desired behavior:
With a time offset, the shifted timestamp uses the same 3-letter month names as the log (Mär, Sep, Jun), so it has the same shape and width as the original. For 21 Mär 2022 11:34:34.505 + 123 ms: date column 21 Mär 2022, time column 11:34:34.628.
GetTimestamp returns the shifted DateTime for these lines.
Offset 0 behaves exactly as today.
Other formats (numeric dates, en-US) are unchanged.
Key interfaces:
TimeFormatDeterminer: formatInfo13–formatInfo15 and their FormatInfo.CultureInfo. A culture whose genitive abbreviated month names equal the abbreviated names is one way to get there; set it up once, not per line. A per-format "format culture" or a fix inside the columnizers is also acceptable, as long as no per-line allocation is added.
TimestampColumnizer.SplitLine (offset branch, both IgnoreFirstChar cases) and GetTimestamp.
SquareBracketColumnizer.SplitLine / SquareSplit (offset branch) and GetTimestamp.
Detection still needs the month to be exactly 3 chars (span[6] == ' '), so the log's own text never has the long forms; don't widen detection in this issue.
Acceptance criteria:
For both SquareBracketColumnizer and TimestampColumnizer: 21 Mär 2022 11:34:34.505 with offset +123 ms gives date column 21 Mär 2022 and time column 11:34:34.628. It fails before the fix.
Covered for both columnizers: a month whose genitive form is 4 chars (März), one whose genitive form is 5 chars (Sept.), and a shift across a month boundary (31 Mai 2022 23:59:59.950 + 123 ms → 01 Jun 2022 / 00:00:00.073).
Covered: all three formats (,fff, .fff, no fraction), and the bracketed form (IgnoreFirstChar) in TimestampColumnizer.
GetTimestamp with an offset returns the shifted time for these lines (not DateTime.MinValue), in both columnizers.
Activity
Hirogen commentedon Nov 22, 2026
Implementation Brief
Category: bug
Summary: With a time offset, German
dd MMM yyyytimestamps must be re-formatted with the same 3-letter month names the log uses, so the date and time columns split correctly.Depends on: #754. Start once it is merged, or on its branch. #754 changes the same offset path in
SquareBracketColumnizer, and this issue assumes its behavior (bracket fields and message split fromnewDate.Length).Verified (on .NET, de-DE):
ParseExact("21 Mär 2022 11:34:34.505", "dd MMM yyyy HH:mm:ss.fff", de-DE)+ 123 ms, formatted with the same format, gives21 März 2022 11:34:34.628.dd MMM, .NET usesAbbreviatedMonthGenitiveNames(Jan.|Feb.|März|Apr.|Mai|Juni|Juli|Aug.|Sept.|Okt.|Nov.|Dez.): 3 to 5 chars. The log and the parser useAbbreviatedMonthNames(Jan|Feb|Mär|…|Dez): always 3 chars. Only May has the same length.31 Mai 2022 23:59:59.950+ 123 ms gives01 Juni 2022 00:00:00.073.ToString("dd MMM yyyy")) still uses the genitive names, so splitting into twoToStringcalls does not keep the 3-letter form.CultureInfoclone whoseDateTimeFormat.AbbreviatedMonthGenitiveNamesis set to itsAbbreviatedMonthNamesformats21 Mär 2022 11:34:34.628,01 Sep 2022 …and01 Jun 2022 ….Current behavior:
With a non-zero time offset,
TimestampColumnizer.SplitLineandSquareBracketColumnizer(SplitLine→SquareSplit) parse the timestamp, add the offset, format it again withformatInfo.DateTimeFormat/formatInfo.CultureInfo, and then cut the date and time columns by the format-string lengths (DateFormat.Length,TimeFormat.Length). ForformatInfo13–formatInfo15inTimeFormatDeterminer(dd MMM yyyy+HH:mm:ss[,.fff], de-DE), the formatted month is longer than 3 chars, so:21 März 202and the time column2 11:34:34.6(off by 2 chars forSept.);GetTimestampbreaks too: both columnizers rebuild the timestamp from columns 0 and 1 ("21 März 202" + " " + "2 11:34:34.6"),ParseExactthrows, and the line getsDateTime.MinValue. With an offset set, these lines lose their timestamp, which affects everything that uses it (time sync, timestamp navigation, time-based filtering).Desired behavior:
Mär,Sep,Jun), so it has the same shape and width as the original. For21 Mär 2022 11:34:34.505+ 123 ms: date column21 Mär 2022, time column11:34:34.628.GetTimestampreturns the shiftedDateTimefor these lines.Key interfaces:
TimeFormatDeterminer:formatInfo13–formatInfo15and theirFormatInfo.CultureInfo. A culture whose genitive abbreviated month names equal the abbreviated names is one way to get there; set it up once, not per line. A per-format "format culture" or a fix inside the columnizers is also acceptable, as long as no per-line allocation is added.TimestampColumnizer.SplitLine(offset branch, bothIgnoreFirstCharcases) andGetTimestamp.SquareBracketColumnizer.SplitLine/SquareSplit(offset branch) andGetTimestamp.span[6] == ' '), so the log's own text never has the long forms; don't widen detection in this issue.Acceptance criteria:
SquareBracketColumnizerandTimestampColumnizer:21 Mär 2022 11:34:34.505with offset +123 ms gives date column21 Mär 2022and time column11:34:34.628. It fails before the fix.31 Mai 2022 23:59:59.950+ 123 ms →01 Jun 2022/00:00:00.073).,fff,.fff, no fraction), and the bracketed form (IgnoreFirstChar) inTimestampColumnizer.GetTimestampwith an offset returns the shifted time for these lines (notDateTime.MinValue), in both columnizers.GetTimestampunchanged.Out of scope:
TimeFormatDeterminer.