Jump to content

relative timestamps


doddsey_65

Recommended Posts

ok so i am using relative timestamps on my forum. if a post was created less than 1 hour ago then it will display something like 32 minutes ago. If it was posted more than 1 hour ago it will display "posted today at 10:00pm", or if it was older than 1 day then it will display the absolute time stamp. My question is how do i get them to update automatically like facebook does? i would like to use jquery for this but after searching i cant make heads or tales of any of it.

 

so to sumarise i would like the timestamps to update without having to refresh the page.

 

Thanks

Link to comment
Share on other sites

Well if you know javascript the concept of ajax shouldn't be too far off for you. Gathering information from another URL on the server without leaving the page, luckily we have libraries like jQuery that have built in ajax commands, like jquery.load(). Look into those two concepts, however I'm not sure how efficient loading the time from another page would be, perhaps there's a simpler javascript way someone can let us in on.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.