1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.0 Relative Timestamps

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

  1. Kier

    Kier XenForo Developer Staff Member

    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 :)
    Dusty777, Bugfix, Eagle and 36 others like this.
  2. Sir nick

    Sir nick Well-Known Member

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

    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

    JulianD Well-Known 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

    pipedreams Active Member

    Amazing feature :)
  6. squall14716

    squall14716 Member

    Very slick indeed.
  7. Kier

    Kier XenForo Developer Staff Member

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

    Jonathan Active Member

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

    Gill Member

    I love this feature!
  10. Enigma

    Enigma Well-Known Member

    Clever implementation. I like it.
  11. Brandon_R

    Brandon_R Guest

    Kier's Theory Of Special Relative Timestamps. I like it.
    ZeWildGuy, EQnoble, Alien and 5 others like this.
  12. MordyT

    MordyT Active Member

  13. Floris

    Floris Guest

    I love this feature! Keep up the good work.
  14. feldon30

    feldon30 Well-Known Member

    This is going to be epic.
  15. Mark.B

    Mark.B Well-Known Member

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

    Floris Guest

    Boothby and Kier like this.
  17. KURTZ

    KURTZ Well-Known Member

    amazing ... :)
  18. dmnkhhn

    dmnkhhn Active Member

    Fantastic, it really works. :)
  19. Sador

    Sador Well-Known Member

  20. Msharry

    Msharry Active Member

Share This Page