Skip to content

Commit ecc5798

Browse files
committed
Remove ban date timezone correction in pinfo
With the inclusion of 3722170, the correction is no longer necessary for new timestamps. Our DB is already in UTC so we get lucky and have no issues.
1 parent b05ffee commit ecc5798

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

api/pinfo.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package api
22

33
import (
44
"net/http"
5-
"time"
65
"wwfc/database"
76
)
87

@@ -48,20 +47,5 @@ func handlePinfoImpl(req PinfoRequest, validSecret bool) (*database.User, int, e
4847
ret = &realUser
4948
}
5049

51-
_, offset := time.Now().Zone()
52-
53-
// Add the offset to the time and then convert it back to local.
54-
// The DB stores times in the server's locale but they are unmarshaled as
55-
// UTC. This corrects for that
56-
if ret.BanIssued != nil {
57-
fixedIssued := ret.BanIssued.Add(time.Duration(-offset) * time.Second).Local()
58-
ret.BanIssued = &fixedIssued
59-
}
60-
61-
if ret.BanExpires != nil {
62-
fixedExpires := ret.BanExpires.Add(time.Duration(-offset) * time.Second).Local()
63-
ret.BanExpires = &fixedExpires
64-
}
65-
6650
return ret, http.StatusOK, nil
6751
}

0 commit comments

Comments
 (0)