parser: fallback zone-less source timestamps to Europe/Moscow

This commit is contained in:
2026-02-28 22:17:00 +03:00
parent 25e3b8bb42
commit 0252264ddc
7 changed files with 53 additions and 19 deletions

View File

@@ -6,6 +6,7 @@ import (
"time"
"git.mchus.pro/mchus/logpile/internal/models"
"git.mchus.pro/mchus/logpile/internal/parser"
)
// ParseSELList parses selelist.csv file with SEL events
@@ -81,7 +82,7 @@ func parseSELTimestamp(dateStr, timeStr string) time.Time {
timestampStr := dateStr + " " + timeStr
// Try parsing with MM/DD/YYYY format
t, err := time.Parse("01/02/2006 15:04:05", timestampStr)
t, err := parser.ParseInDefaultArchiveLocation("01/02/2006 15:04:05", timestampStr)
if err != nil {
// Fallback to current time
return time.Now()