Skip to content Skip to sidebar Skip to footer

Getting Elapsed Time In Js

Fiddle I am making a social network and when you post something, I want to show the time. I have the current code to display the time (this isn't only the time, it's also validatin

Solution 1:

fiddle

Basically you set up a setInterval which governs ho frequently you update your time attribute. I used a span with a class .time to so you could theoretically update anything with time.

I would go further and hash your posts so you can easily retrieve each posts original time.

EDIT: added a new fiddle.

Post a Comment for "Getting Elapsed Time In Js"