Skip to content

Commit

Permalink
fix: Parse time from file names in the local system timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMcH authored and ThinkChaos committed Feb 6, 2024
1 parent 2973045 commit 178dbb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion querylog/file_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (d *FileWriter) CleanUp() {
// search for log files, which names starts with date
for _, f := range files {
if strings.HasSuffix(f.Name(), ".log") && len(f.Name()) > 10 {
t, err := time.Parse("2006-01-02", f.Name()[:10])
t, err := time.ParseInLocation("2006-01-02", f.Name()[:10], time.Local)
if err == nil {
differenceDays := uint64(time.Since(t).Hours() / hoursPerDay)
if d.logRetentionDays > 0 && differenceDays > d.logRetentionDays {
Expand Down

0 comments on commit 178dbb7

Please sign in to comment.