最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Converting a timestamp to a relative datetime (e.g., "2 minutes ago") and continuously updating it with

programmeradmin6浏览0评论

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 HTML and then Javascript continuously calculate the time ago; does anybody know any more info about this?

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 HTML and then Javascript continuously calculate the time ago; does anybody know any more info about this?

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Apr 10, 2010 at 16:17 Gandalf StormCrowGandalf StormCrow 26.2k70 gold badges179 silver badges268 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 22

http://timeago.yarp.com/

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

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论