问题:
Given a specific DateTime
value, how do I display relative time, like: 给定特定的DateTime
值,如何显示相对时间,例如:
- 2 hours ago 2小时前
- 3 days ago 3天前
- a month ago 一个月前
解决方案:
参考一: https://stackoom.com/question/B/用C-计算相对时间参考二: https://oldbug.net/q/B/Calculate-relative-time-in-C
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/3217898