Posts Tagged ‘shock top’

12
4/09
3

Relative to Relative Time

In the original implementation of my forum site, times were all displayed as absolute times. The server sits in the Central Time Zone and at least 90% of the users, including me, are in the same time zone. I never found this a problem, until I spent a few months outside Central Time. My first reaction was to let users set their own time zone and then adjust the times automatically for them. Before implementing this, I found this post from http://blog.stackoverflow.com and decided to rethink my plan. Relative times would provide a simple solution to my problem and would help users in the future as more and more move out of the Central Time Zone.

Everything was working great until a few months in, when old posts were marked as made “about 3 months ago.” By itself, this was not a problem, but edited posts are tagged as edited and would read “about 3 months ago and edited about 3 months ago.” Users are only allowed a 30 minute window to edit posts after they are made, so old, edited posts will always read like they were posted and edited at the same time. Fixing this now requires even more relative time. By marking posts as made “about 3 months ago and edited 4 minutes later” I can still provide the important information that a user is looking for, and not have to worry about time zones.