Skip to content

Commit

Permalink
Use the full timestamp provided by chat (#19)
Browse files Browse the repository at this point in the history
* feat: use unix time with milliseconds

* chore: bump go.mod version

* refactor: use stock unix milliseconds function

* chore: less specific go version
  • Loading branch information
vyneer authored Oct 17, 2023
1 parent 56258b4 commit 51367cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/MemeLabs/dggchat

go 1.15
go 1.21

require github.com/gorilla/websocket v1.4.2
2 changes: 1 addition & 1 deletion parsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func parsePing(s string) (Ping, error) {
}

func unixToTime(stamp int64) time.Time {
return time.Unix(stamp/1000, 0)
return time.UnixMilli(stamp)
}

func timeToUnix(t time.Time) int64 {
Expand Down

0 comments on commit 51367cf

Please sign in to comment.