This message was deleted.
# helpdesk
s
This message was deleted.
a
hmm golang’s
time.Now()
includes timezone info (go playground demonstration). When you set the timezone of your server, did it perhaps sync the system clock?
d
But if use time.now then notBefore or Expiry don't include timezone info. It's storing only current timestamp based on device timezone. Using UTC should avoid this type problem.
a
ah, I see what you’re saying, but jwt.NewNumericDate calls time.Unix() which converts to UTC (go playground demonstration). Plus I believe the servers we run for LiveKit Cloud actually are all set to local time, and we don’t have any problems with token generation what was the actual timezone problem you were seeing? you say it was “failing to verify”, what error did you get?
d
I think in that case https://github.com/livekit/protocol/blob/cfc741037c9339ee177557ae01825ff0d5d542ad/auth/verifier.go#L73 will need to use
jwt.NewNumericDate
too but as you said in LiveKit Cloud you're using local time then I'm bit confused here. Because for my case I faced problem when expiration duration was too short.
d
which time zone does it return on your machine? as long as the timezone is correct, time comparisons should behave correctly.