Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
SSDD47607yI wouldn't have thought that would have caused that issue. The time stamp is normally dependant in the server time is it not?
-
@SSDD It's generated and stored server side. However, the client doesn't get a relative time (e.g. "x days ago") from the server, but a unix epoch timestamp, which the client is responsible to decode and convert into a relative one. If this timestamp however is in the past from the view of the client (as the client lives three days in the future), it will display something odd like that.
-
SSDD47607yOk thanks for that. I've just written something that handles this and I did it all server side.
-
@SSDD It is definitely possible and more convenient as you don't have to care about other timezones or wrong date/time settings on the client, however sometimes it makes more sense to render it on the client side.
-
This was a cool mystery story. Almost scary. I like the fact that in reality you were the culprit. Man, what a plot twist.
I just spent an hour debugging my company's web app. More specifically, I was trying to fix a bug that made a label on a comment I just made say "Posted 3 days ago".
After confirming timestamps on the server are correct with a calculator, fiddling around with the js debugger, and ruling out weird timezone-related shenanigans, I came to a conclusion.
The bug was in fact sitting, quite comfortably, between the chair and the keyboard.
Yesterday I had moved the date on my computer roughly 3 days into the future, because I was testing out some unrelated code that was dealing with Redis, and I wanted to expire all of the keys stored inside of it.
Don't blame me, my parents told me I had fallen onto my head as a child.
undefined
pebkac id10t