Relative Timestamps

Discussion in 'Have You Seen...?' started by Kier, Jul 29, 2010.

  1. Kier XenForo Developer

    In the beginning, dates next to content on the internet were ugly things. We used to see date/time strings like 07-29-2010 16:31 and that would be it.

    Then, options were added to allow administrators to specify a date/time format, and you could see output such as 4:31pm, Thursday June 29th 2010.

    Later still, it was possible to output times relative to the present, so one could see dates like 3 minutes ago or Yesterday at 6:15pm.

    However, these relative dates can be nasty when it comes to anything that is going to cache the page output. If a search engine slurps up the page, its cache is going to forever be wrong, as it will be locked at 3 minutes ago even when the content is weeks old. This can also be a problem for long threads. By the time you reach the bottom of a long page, the posts at the bottom could be several minutes older than when they were loaded into your browser, so their 2 minutes ago output is completely wrong.

    XenForo addresses this by always outputting absolute dates and times, but our Javascript then identifies these instances and converts them into relative dates for the viewing user.

    The icing on the cake is that all date/time instances automatically update as time goes by. If reply to a thread, your message will be posted and its date and time will be noted as 'A moment ago'. Wait a little while, and it will automatically update to read '1 minute ago' and will continue until it no longer makes sense to display a relative date.

    I have yet to grow tired of seeing all the dates in a thread simultaneously update all by themselves :)
    Fuhrmann, Saeed, krstep and 32 others like this.
  2. Sir nick Active Member

    Yes the time stamps i love :). Really nice and clean feature.
  3. Shamil Well-Known Member

    I actually like this method. I didn't think this was possible, hence I stuck to the exemplar in my custom CMS. I'll certainly look into this.
  4. JulianD Active Member

    Very nice functionality. So, if I load a page with JS disabled (and this is what crawlers see), I'm going to see the actual date the post was made?
  5. pipedreams Active Member

    Amazing feature :)
  6. squall14716 Member

    Very slick indeed.
  7. Kier XenForo Developer

    That's correct. Or just view the HTML source.
  8. Jonathan Active Member

    Very clever. This software is becoming more and more promising :3
  9. Gill Member

    I love this feature!
  10. Enigma Well-Known Member

    Clever implementation. I like it.
  11. Brandon_R Guest

    Kier's Theory Of Special Relative Timestamps. I like it.
    EQnoble, Alien, GodForum.com and 4 others like this.
  12. MordyT Active Member

    Awesome!
  13. Floris XenFans Guy

    I love this feature! Keep up the good work.
  14. feldon30 Well-Known Member

    This is going to be epic.
  15. Mark.B Well-Known Member

    Just unreal...in a good way...:eek:
  16. Floris XenFans Guy

    Boothby and Kier like this.
  17. KURTZ Well-Known Member

    amazing ... :)
  18. dmnkhhn Active Member

    Fantastic, it really works. :)
  19. Sador Well-Known Member

    Awesome.
  20. Msharry Active Member

Share This Page