The question is how to format a JavaScript Date
as a string stating the time elapsed similar to the way you see times displayed on Stack Overflow.
(问题是如何将JavaScript Date
格式化为字符串,以说明经过的时间,类似于您看到Stack Overflow上显示的时间的方式。)
eg
(例如)
- 1 minute ago
(1分钟前)
- 1 hour ago
(1小时前)
- 1 day ago
(1天前)
- 1 month ago
(1个月前)
- 1 year ago
(1年以前)
ask by Sky Sanders translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…