My forum is giving the age of a post based on the clock of the client, thus being wrong. For instance if a post was made at 5 pm, and i check it back a 9:10 pm, and in my devices’ clock its 5:10pm, the forum says the post was made just ten minutes ago. How can i fix this?
One of the clocks must be wrong (or have the wrong timezone). If your client clock is correct, then the server clock must be wrong. Try logging into the server via SSH, and running date
Thats the point. If the client clock is wrong, forum will give wrong timestamps. it shouldnt be like that.
What about a reader visiting the forum from a diferent timezone? will he get all times wrong too?
is this solvable?..
I can indeed replicate this if I mess around with my system clock, e.g. for @david’s post above if I change my time to 11:05am (I am in Australia) I can get “7m ago”. If I change my timezone without changing my clock I get the correct behaviour, for example it still says “3h ago”, just with different times shown on hover because of the different timezone.
I am not sure what you would like to be solved here? The “Xm ago” message will always be based on the client, because then it is relative to the client’s system clock and timezone settings. Having an incorrect system clock on the client is unlikely because most of the time their clock and timezone is automatically set via the internet.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.