Skip to content

Commit

Permalink
Fix timezone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelsvartveit committed Sep 14, 2024
1 parent d092bc6 commit 28512a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,19 @@ func listArticles(page int, limit int) []Article {
return nil
}

norwayTimezone, err := time.LoadLocation("Europe/Oslo")
if err != nil {
fmt.Println("Error loading timezone:", err)
}

var articles []Article
for _, row := range articleRows {
article := Article{
Title: row.Title,
Description: row.Description,
ArticleUrl: row.ArticleUrl,
ImageUrl: row.ImageUrl,
Time: time.Unix(row.Timestamp, 0),
Time: time.Unix(row.Timestamp, 0).In(norwayTimezone),
Sentiment: row.Sentiment,
}

Expand Down

0 comments on commit 28512a8

Please sign in to comment.