rs / zerolog

Zero Allocation JSON Logger
MIT License
10.62k stars 572 forks source link

ConsoleWriter fallbacks to local timezone for missing TZ indicator #497

Closed pscheid92 closed 2 years ago

pscheid92 commented 2 years ago

Closes issue #483

Before: We use time.Parse which defaults to TZ UTC if there is no time zone indicator specified in the time layout string. During the reparsing in ConsoleWriter we therefore added the TZ difference to UTC twice.

After: We use time.ParseInLocal where we need to provide a dedicated fallback TZ as a fallback. Since we now fallback to the local TZ, we don't add the TZ difference to UTC twice.