yourcelf / intertwinkles

A collection of web apps for group decision making and collaboration
BSD 2-Clause "Simplified" License
45 stars 6 forks source link

Timestamp issues #32

Closed SwartzCr closed 11 years ago

SwartzCr commented 11 years ago

If the user's computer clock has a different time than the server clock the time widgits next to created items show negative numbers.

yourcelf commented 11 years ago

Just to clarify: "different time" means a time that is not in accordance with global time servers (e.g. 5 or 10 minutes fast/slow), and not a different time zone, right? The times displayed in the browser should all be "local time", so time zone changes should be handled correctly. (Server time is UTC).

If your system thinks it's in Eastern time, but its clock is 5 minutes behind, the browser might think that the date something was just added is 5 minutes in the future.

I did take extra care to deal with "incorrect" local clocks for Progressive Clock to avoid introducing errors, but I didn't do that elsewhere. The only reasonable way to fix is to have the server tell the browser what time the server thinks it is and then adjust.

I might just fix the date display widget to display "month/day" format dates if the time diff is negative.

SwartzCr commented 11 years ago

My computer's time is set 5 minutes slow. A replacement for (small) negative numbers would be to have it say 'just now!' or something, so that you still know it was recent, but not to give it a strange looking time/date when other recently added items will say something like '1m' or '1h'

yourcelf commented 11 years ago

I like "just now" aesthetically... but you'll still see "wrong" times even if it's not a future time. For example, if something is posted at "12pm" time server time:

Maybe we don't care about small discrepancies in time (I think we don't). But if we want to keep "ago" style timing rather than absolute timing, we'll need to set whatever accuracy threshold we don't care and have it be "Just now" till then across the board, or have the server tell the browser the reference point from which to compute.

yourcelf commented 11 years ago

Fixed through introduction of a global clock skew correction routine.