Converting a timestamp to a relative date/time (e.g., “2 minutes ago”) and continuously updating it with Javascript

后端 未结 2 554
清酒与你
清酒与你 2021-02-09 07:29

Does anybody know how did Facebook do that "time ago". I\'m trying to do the same with PHP/Javascript

I think it works something like PHP renders timestamp in H

相关标签:
2条回答
  • 2021-02-09 07:55

    http://timeago.yarp.com/

    This is a great jQuery plugin for it, and it explains the concept quite concisely.

    0 讨论(0)
  • 2021-02-09 08:12

    Here's another fully-customizable alternative: https://github.com/layam/js_humanized_time_span

    0 讨论(0)
提交回复
热议问题