Skip to content

Commit

Permalink
Set times to utc when reading from database
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed May 6, 2023
1 parent 102b151 commit 8100386
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion database/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (f *File) Scan(row dbutil.Scannable) *File {
}
f.ID = fileID.String
f.EmojiName = emojiName.String
f.Timestamp = time.UnixMilli(timestamp)
f.Timestamp = time.UnixMilli(timestamp).UTC()
f.Width = int(width.Int32)
f.Height = int(height.Int32)
f.MXC, err = id.ParseContentURI(mxc)
Expand Down
2 changes: 1 addition & 1 deletion database/userportal.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (up UserPortal) Scan(l log.Logger, row dbutil.Scannable) *UserPortal {
l.Errorln("Error scanning user portal:", err)
panic(err)
}
up.Timestamp = time.UnixMilli(ts)
up.Timestamp = time.UnixMilli(ts).UTC()
return &up
}

Expand Down

0 comments on commit 8100386

Please sign in to comment.